Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b720f78482 | ||
|
efb8c69bbc | ||
|
3b8f64569e | ||
|
a370cc6537 |
@@ -34,7 +34,7 @@ project (OCCT)
|
|||||||
# Solution folder property
|
# Solution folder property
|
||||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
|
set (INSTALL_OCCT_TEST_CASES OFF CACHE BOOL "${INSTALL_OCCT_TEST_CASES_DESCR}")
|
||||||
# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
|
# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
|
||||||
# check this variable and set if it's required
|
# check this variable and set if it's required
|
||||||
if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
|
if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
|
||||||
@@ -48,7 +48,7 @@ if (OCCT_ALGO_EXTENDED_OUTPUT)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# copy samples to install directory
|
# copy samples to install directory
|
||||||
set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}")
|
set (INSTALL_OCCT_SAMPLES OFF CACHE BOOL "${INSTALL_OCCT_SAMPLES_DESCR}")
|
||||||
|
|
||||||
# install dir of the built project
|
# install dir of the built project
|
||||||
set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" )
|
set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" )
|
||||||
@@ -86,11 +86,6 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
|
|||||||
BUILD_MODULE (${OCCT_MODULE})
|
BUILD_MODULE (${OCCT_MODULE})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if (ANDROID AND BUILD_MODULE_Draw)
|
|
||||||
message (STATUS "Info. Draw module is turned off due to it is not supported on Android")
|
|
||||||
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Overview
|
# Overview
|
||||||
set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
|
set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
|
||||||
|
|
||||||
@@ -138,7 +133,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
|
|||||||
list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
|
list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
|
||||||
list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
|
list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
|
||||||
|
|
||||||
if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1)
|
if (NOT "${CAN_REBUILD_PDC_FOR_TKMATH}" STREQUAL "-1" OR NOT "${CAN_REBUILD_PDC_FOR_STEPFILE}" STREQUAL "-1")
|
||||||
set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}")
|
set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}")
|
||||||
else()
|
else()
|
||||||
OCCT_CHECK_AND_UNSET (REBUILD_PLATFORM_DEPENDENT_CODE)
|
OCCT_CHECK_AND_UNSET (REBUILD_PLATFORM_DEPENDENT_CODE)
|
||||||
@@ -146,30 +141,36 @@ endif()
|
|||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_DIR)
|
if (NOT DEFINED 3RDPARTY_DIR)
|
||||||
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
||||||
get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
|
endif()
|
||||||
|
|
||||||
|
# search for 3rdparty dir
|
||||||
|
if ("${3RDPARTY_DIR}" STREQUAL "")
|
||||||
|
if (DEFINED ENV{3RDPARTY_DIR})
|
||||||
|
set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
|
||||||
|
elseif (EXISTS "${CMAKE_SOURCE_DIR}/../")
|
||||||
|
# in version 6.7.0 and above, occt parent directory contains 3rdparties
|
||||||
|
get_filename_component (3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/../" ABSOLUTE)
|
||||||
|
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
|
# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
|
||||||
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
|
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
|
||||||
|
|
||||||
if (USE_TCL)
|
if ("${USE_TCL}" STREQUAL ON)
|
||||||
message (STATUS "Info: TCL is used by OCCT")
|
message (STATUS "Info: TCL is used by OCCT")
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
|
||||||
|
|
||||||
message (STATUS "Info: TK is used by OCCT")
|
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
|
|
||||||
else()
|
else()
|
||||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
|
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
|
||||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
||||||
|
|
||||||
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
|
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
|
||||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
|
# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
|
||||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
|
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
|
||||||
|
|
||||||
if (USE_FREETYPE)
|
if ("${USE_FREETYPE}" STREQUAL ON)
|
||||||
message (STATUS "Info: Freetype is used by OCCT")
|
message (STATUS "Info: Freetype is used by OCCT")
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
|
||||||
else()
|
else()
|
||||||
@@ -185,7 +186,7 @@ if (USE_VTK)
|
|||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
|
||||||
else()
|
else()
|
||||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
|
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
|
||||||
#OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
|
OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# D3D
|
# D3D
|
||||||
@@ -363,23 +364,19 @@ if ("${INSTALL_DIR}" STREQUAL "")
|
|||||||
message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}")
|
message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
message (STATUS "\nInfo: Collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
|
||||||
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 all the headers to <binary dir>/inc folder
|
||||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
|
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")
|
|
||||||
|
|
||||||
OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}")
|
OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}")
|
||||||
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples")
|
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples")
|
||||||
|
|
||||||
if (INSTALL_SAMPLES)
|
if (INSTALL_OCCT_SAMPLES)
|
||||||
OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}")
|
OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (INSTALL_TEST_CASES)
|
if (INSTALL_OCCT_TEST_CASES)
|
||||||
OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}")
|
OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -475,9 +472,6 @@ foreach(RESOURCE ${RESOURCES})
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# define CSF variable
|
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
|
|
||||||
|
|
||||||
# include patched toolkit projects or original ones
|
# include patched toolkit projects or original ones
|
||||||
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
||||||
OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")
|
OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")
|
||||||
|
@@ -67,7 +67,6 @@ n GeomLProp
|
|||||||
n GeomLib
|
n GeomLib
|
||||||
n GeomProjLib
|
n GeomProjLib
|
||||||
n GeomTools
|
n GeomTools
|
||||||
n GeomEvaluator
|
|
||||||
n Hermit
|
n Hermit
|
||||||
n IntAna
|
n IntAna
|
||||||
n IntAna2d
|
n IntAna2d
|
||||||
@@ -431,4 +430,3 @@ n IVtkTools
|
|||||||
t TKIVtk
|
t TKIVtk
|
||||||
n IVtkDraw
|
n IVtkDraw
|
||||||
t TKIVtkDraw
|
t TKIVtkDraw
|
||||||
n Geom2dEvaluator
|
|
||||||
|
@@ -1,103 +1,113 @@
|
|||||||
##
|
#
|
||||||
|
|
||||||
if(3RDPARTY_MACRO_ALREADY_INCLUDED)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(3RDPARTY_MACRO_ALREADY_INCLUDED 1)
|
|
||||||
|
|
||||||
|
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||||
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||||
|
|
||||||
macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEBUG)
|
macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEBUG)
|
||||||
|
|
||||||
if (NOT DEFINED INSTALL_${PRODUCT_NAME})
|
# define 3RDPARTY_${PRODUCT_NAME}_DIR variable is it isn't defined
|
||||||
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "${INSTALL_${PRODUCT_NAME}_DESCR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
|
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}")
|
set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
# search for product directory inside 3RDPARTY_DIR directory
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_DIR AND 3RDPARTY_DIR)
|
||||||
|
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "${PRODUCT_NAME}" ${PRODUCT_NAME}_DIR_NAME)
|
||||||
# specify product folder in connectin with 3RDPARTY_DIR
|
if (${PRODUCT_NAME}_DIR_NAME)
|
||||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
message (STATUS "Info: ${PRODUCT_NAME}: ${${PRODUCT_NAME}_DIR_NAME} folder is used")
|
||||||
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}")
|
set (3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
|
||||||
|
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
|
|
||||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" ${PRODUCT_NAME} ${PRODUCT_NAME}_DIR_NAME)
|
|
||||||
if (${PRODUCT_NAME}_DIR_NAME)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
#set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
if (NOT DEFINED INSTALL_${PRODUCT_NAME})
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE PATH "the path of ${HEADER_NAME}")
|
message (STATUS "${INSTALL_${PRODUCT_NAME}_DESCR}")
|
||||||
|
if (NOT "${INSTALL_${PRODUCT_NAME}_DESCR}" STREQUAL "")
|
||||||
|
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "${INSTALL_${PRODUCT_NAME}_DESCR}")
|
||||||
|
else()
|
||||||
|
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} required to be copied into install directory")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
# search for include directory
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
|
||||||
|
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS
|
||||||
|
"${3RDPARTY_${PRODUCT_NAME}_DIR}/include"
|
||||||
|
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_HEADER}
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||||
|
elseif (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||||
|
get_filename_component(3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
||||||
|
if (NOT "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP}")
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# search for library
|
||||||
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||||
|
|
||||||
|
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} PATHS
|
||||||
|
"${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}"
|
||||||
|
"${3RDPARTY_${PRODUCT_NAME}_DIR}/lib"
|
||||||
|
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_LIB}
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
# second search if previous one do not find anything
|
||||||
|
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library")
|
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# library path
|
||||||
|
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||||
|
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# search for shared library (just for win case)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library")
|
elseif (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||||
endif()
|
get_filename_component(3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
||||||
endif()
|
if (NOT "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP}")
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||||
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR PATH "the path to ${PRODUCT_NAME}")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY FILEPATH "the path to ${PRODUCT_NAME} library")
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR PATH "The directory containing ${PRODUCT_NAME} library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL FILEPATH "the path to ${PRODUCT_NAME} shared library")
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
else()
|
|
||||||
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR PATH "The directory containing ${PRODUCT_NAME} shared library")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
# header
|
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||||
|
|
||||||
# set 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR
|
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}" PATHS
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to ${HEADER_NAME}" FORCE)
|
"${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}"
|
||||||
|
"${3RDPARTY_${PRODUCT_NAME}_DIR}/bin"
|
||||||
|
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_DLL}
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
|
# second search if previous one do not find anything
|
||||||
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
|
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}")
|
||||||
PATHS ${3RDPARTY_${PRODUCT_NAME}_DIR}
|
endif()
|
||||||
PATH_SUFFIXES include
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||||
NO_DEFAULT_PATH)
|
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
||||||
else()
|
endif()
|
||||||
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
|
|
||||||
PATH_SUFFIXES include
|
# shared library path
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||||
|
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
||||||
|
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -105,79 +115,16 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
|
|||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
||||||
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The path to ${HEADER_NAME}" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# library
|
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
|
|
||||||
|
|
||||||
set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
|
|
||||||
if (ANDROID)
|
|
||||||
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} libs/${ANDROID_ABI})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY NAMES ${LIBRARY_NAME}
|
|
||||||
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
|
|
||||||
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY NAMES ${LIBRARY_NAME}
|
|
||||||
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||||
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# shared library
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
if (3RDPARTY_${PRODUCT_NAME}_DLL OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||||
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
|
||||||
|
|
||||||
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL NAMES ${LIBRARY_NAME}
|
|
||||||
PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}"
|
|
||||||
PATH_SUFFIXES bin
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL NAMES ${LIBRARY_NAME} PATH_SUFFIXES bin)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||||
@@ -245,60 +192,3 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
|
|||||||
|
|
||||||
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
|
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME)
|
|
||||||
if (3RDPARTY_${LIBNAME}_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DIR}")
|
|
||||||
# include dir
|
|
||||||
set (DOES_PATH_CONTAIN FALSE)
|
|
||||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
|
||||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
if (NOT DOES_PATH_CONTAIN)
|
|
||||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# library dir
|
|
||||||
set (DOES_PATH_CONTAIN FALSE)
|
|
||||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
|
||||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
|
||||||
endif()
|
|
||||||
if (NOT DOES_PATH_CONTAIN)
|
|
||||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# shared library dir
|
|
||||||
if (WIN32)
|
|
||||||
set (DOES_PATH_CONTAIN FALSE)
|
|
||||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
|
||||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
|
||||||
endif()
|
|
||||||
if (NOT DOES_PATH_CONTAIN)
|
|
||||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check library
|
|
||||||
set (DOES_PATH_CONTAIN FALSE)
|
|
||||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
|
||||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
|
||||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (NOT DOES_PATH_CONTAIN)
|
|
||||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check shared library
|
|
||||||
if (WIN32)
|
|
||||||
set (DOES_PATH_CONTAIN FALSE)
|
|
||||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
|
||||||
if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
|
||||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (NOT DOES_PATH_CONTAIN)
|
|
||||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
|
@@ -9,7 +9,7 @@ endif()
|
|||||||
# BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
|
# BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
|
||||||
set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
|
set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
|
||||||
|
|
||||||
find_package (BISON)
|
find_package (Bison)
|
||||||
|
|
||||||
if (BISON_FOUND)
|
if (BISON_FOUND)
|
||||||
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
|
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
|
||||||
|
@@ -8,27 +8,29 @@ if (NOT DEFINED 3RDPARTY_FREETYPE_DIR)
|
|||||||
set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype")
|
set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# store ENV{FREETYPE_DIR}
|
||||||
|
SET (CACHED_FREETYPE_DIR $ENV{FREETYPE_DIR})
|
||||||
|
|
||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||||
|
|
||||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||||
OCCT_MAKE_COMPILER_BITNESS()
|
OCCT_MAKE_COMPILER_BITNESS()
|
||||||
|
|
||||||
# specify freetype folder in connectin with 3RDPARTY_DIR
|
if (NOT ENV{FREETYPE_DIR})
|
||||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
# search for freetype in user defined directory
|
||||||
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype")
|
if (NOT 3RDPARTY_FREETYPE_DIR AND 3RDPARTY_DIR)
|
||||||
|
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" FREETYPE FREETYPE_DIR_NAME)
|
||||||
if (NOT 3RDPARTY_FREETYPE_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" FREETYPE FREETYPE_DIR_NAME)
|
|
||||||
if (FREETYPE_DIR_NAME)
|
if (FREETYPE_DIR_NAME)
|
||||||
set (3RDPARTY_FREETYPE_DIR "${3RDPARTY_DIR}/${FREETYPE_DIR_NAME}" CACHE PATH "The directory containing freetype" FORCE)
|
set (3RDPARTY_FREETYPE_DIR "${3RDPARTY_DIR}/${FREETYPE_DIR_NAME}" CACHE PATH "The directory containing freetype" FORCE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
#set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype" FORCE)
|
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
||||||
|
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# define required freetype variables
|
|
||||||
if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path of ft2build.h")
|
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path of ft2build.h")
|
||||||
endif()
|
endif()
|
||||||
@@ -37,257 +39,173 @@ if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
|||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path of freetype2")
|
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path of freetype2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY OR NOT 3RDPARTY_FREETYPE_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY OR NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
|
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library")
|
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL OR NOT 3RDPARTY_FREETYPE_DLL_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL OR NOT 3RDPARTY_FREETYPE_DLL_DIR)
|
||||||
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL_DIR)
|
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL_DIR)
|
||||||
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE PATH "The directory containing freetype shared library")
|
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing freetype shared library")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# check 3RDPARTY_FREETYPE_ paths for consistency with specified 3RDPARTY_FREETYPE_DIR
|
find_package(Freetype)
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build FILEPATH "the path to ft2build.h")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "the path to ftheader.h")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_LIBRARY FILEPATH "the path to freetype library")
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
# ft2build header
|
||||||
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
if (FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${FREETYPE_INCLUDE_DIR_ft2build}")
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
|
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||||
else()
|
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "${FREETYPE_INCLUDE_DIR_ft2build}" CACHE FILEPATH "the path of ft2build.h" FORCE)
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_LIBRARY_DIR PATH "The directory containing freetype library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_DLL FILEPATH "the path to freetype shared library")
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
|
||||||
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
|
|
||||||
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE PATH "The directory containing freetype shared library" FORCE)
|
|
||||||
else()
|
|
||||||
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR 3RDPARTY_FREETYPE_DLL_DIR PATH "The directory containing freetype shared library")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# the FIRST step in search for freetype library and header folders (built-in search engine)
|
if (NOT FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||||
|
# cmake (version is < 3.0) doesn't find ftheader.h of freetype (version is >= 2.5.1)
|
||||||
# execute built-in search engine to seek freetype
|
|
||||||
set (IS_BUILTIN_SEARCH_REQUIRED OFF)
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
|
||||||
set (IS_BUILTIN_SEARCH_REQUIRED ON)
|
|
||||||
elseif (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
|
||||||
set (IS_BUILTIN_SEARCH_REQUIRED ON)
|
|
||||||
elseif (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
|
||||||
set (IS_BUILTIN_SEARCH_REQUIRED ON)
|
|
||||||
#elseif (WIN32)
|
|
||||||
#if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
|
||||||
# set (IS_BUILTIN_SEARCH_REQUIRED ON)
|
|
||||||
#endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (IS_BUILTIN_SEARCH_REQUIRED)
|
|
||||||
|
|
||||||
# use 3RDPARTY_FREETYPE_DIR if it is specified for freetype search
|
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
set (CACHED_FREETYPE_DIR $ENV{FREETYPE_DIR})
|
|
||||||
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Freetype)
|
|
||||||
|
|
||||||
# restore ENV{FREETYPE_DIR}
|
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check the found paths for consistency with specified 3RDPARTY_FREETYPE_DIR
|
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "the path to ft2build.h")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "the path to ftheader.h")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY FILEPATH "freetype library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# assign the found paths to corresponding 3RDPARTY_FREETYPE_ variables
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
|
||||||
if (FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${FREETYPE_INCLUDE_DIR_ft2build}")
|
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "${FREETYPE_INCLUDE_DIR_ft2build}" CACHE FILEPATH "the path to ft2build.h" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
|
||||||
if (FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${FREETYPE_INCLUDE_DIR_freetype2}" CACHE FILEPATH "the path to ftheader.h" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
|
||||||
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "The path to freetype library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# the SECOND step in search for freetype library and header folders (additional search algorithms)
|
|
||||||
|
|
||||||
# ft2build.h
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
|
||||||
set (FT2BUILD_NAMES ft2build.h config/ft2build.h freetype/config/ft2build.h)
|
|
||||||
|
|
||||||
# set 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build
|
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build-NOTFOUND" CACHE FILEPATH "the path to ft2build.h" FORCE)
|
|
||||||
|
|
||||||
# cmake (version < 3.0) doesn't find ft2build.h of freetype (version is >= 2.5.1)
|
|
||||||
# do search taking into account freetype structure of 2.5.1 version
|
# do search taking into account freetype structure of 2.5.1 version
|
||||||
|
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES
|
||||||
|
freetype/config/ftheader.h
|
||||||
|
config/ftheader.h
|
||||||
|
HINTS
|
||||||
|
ENV FREETYPE_DIR
|
||||||
|
PATHS
|
||||||
|
/usr/X11R6
|
||||||
|
/usr/local/X11R6
|
||||||
|
/usr/local/X11
|
||||||
|
/usr/freeware
|
||||||
|
PATH_SUFFIXES include/freetype2 include freetype2
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES freetype/config/ftheader.h config/ftheader.h)
|
||||||
|
elseif (FREETYPE_INCLUDE_DIR_freetype2 OR EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
||||||
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build NAMES ${FT2BUILD_NAMES}
|
get_filename_component (3RDPARTY_FREETYPE_DIR_ABS "${3RDPARTY_FREETYPE_DIR}" ABSOLUTE)
|
||||||
PATHS ${3RDPARTY_FREETYPE_DIR}
|
get_filename_component (FREETYPE_INCLUDE_DIR_freetype2_ABS "${FREETYPE_INCLUDE_DIR_freetype2}" ABSOLUTE)
|
||||||
PATH_SUFFIXES include freetype2 include/freetype2
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build NAMES ${FT2BUILD_NAMES}
|
|
||||||
PATHS /usr/X11R6 /usr/local/X11R6 /usr/local/X11 /usr/freeware
|
|
||||||
PATH_SUFFIXES include/freetype2 include freetype2
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
string (REGEX MATCH "${3RDPARTY_FREETYPE_DIR_ABS}" DOES_PATH_CONTAIN "${FREETYPE_INCLUDE_DIR_freetype2_ABS}")
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
|
||||||
|
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path to ft2build.h" FORCE)
|
if (NOT DOES_PATH_CONTAIN) # if cmake found freetype2 at different place from 3RDPARTY_FREETYPE_DIR
|
||||||
endif()
|
# search for freetype2 in 3RDPARTY_FREETYPE_DIR and if it will be found - replace freetyp2 path by new one
|
||||||
|
set (TMP_FREETYPE2 "TMP_FREETYPE2-NOTFOUND" CACHE FILEPATH "" FORCE)
|
||||||
|
find_path (TMP_FREETYPE2 NAMES freetype/config/ftheader.h config/ftheader.h
|
||||||
|
PATHS "${3RDPARTY_FREETYPE_DIR}"
|
||||||
|
PATH_SUFFIXES include/freetype2 include freetype2
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
# ftheader.h
|
if (TMP_FREETYPE2 OR NOT EXISTS "${TMP_FREETYPE2}")
|
||||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${TMP_FREETYPE2}" CACHE FILEPATH "the path of freetype2" FORCE)
|
||||||
set (FTHEADER_NAMES ftheader.h config/ftheader.h freetype/config/ftheader.h)
|
|
||||||
|
|
||||||
# set 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2
|
# hide and remove TMP_FREETYPE2
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2-NOTFOUND" CACHE FILEPATH "the path to ftheader.h" FORCE)
|
mark_as_advanced (TMP_FREETYPE2)
|
||||||
|
unset (TMP_FREETYPE2)
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
endif()
|
||||||
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 NAMES ${FTHEADER_NAMES}
|
|
||||||
HINTS ${3RDPARTY_FREETYPE_DIR}
|
|
||||||
PATH_SUFFIXES include/freetype2 include freetype2
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_path (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 NAMES ${FTHEADER_NAMES}
|
|
||||||
PATHS /usr/X11R6 /usr/local/X11R6 /usr/local/X11 /usr/freeware
|
|
||||||
PATH_SUFFIXES include/freetype2 include freetype2
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
|
||||||
|
|
||||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path to ftheader.h" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# freetype library
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
|
|
||||||
|
|
||||||
set (FREETYPE_PATH_SUFFIXES lib)
|
|
||||||
if (ANDROID)
|
|
||||||
set (FREETYPE_PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES} libs/${ANDROID_ABI})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set 3RDPARTY_FREETYPE_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_LIBRARY
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY "3RDPARTY_FREETYPE_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to freetype library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
find_library (3RDPARTY_FREETYPE_LIBRARY freetype
|
|
||||||
PATHS "${3RDPARTY_FREETYPE_LIBRARY_DIR}" "${3RDPARTY_FREETYPE_DIR}"
|
|
||||||
PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_FREETYPE_LIBRARY freetype
|
|
||||||
PATH_SUFFIXES ${FREETYPE_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_LIBRARY_DIR AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
|
||||||
|
|
||||||
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "The path to freetype library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# freetype shared library
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
|
||||||
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
|
||||||
|
|
||||||
# set 3RDPARTY_FREETYPE_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FREETYPE_DLL
|
|
||||||
set (3RDPARTY_FREETYPE_DLL "3RDPARTY_FREETYPE_DLL-NOTFOUND" CACHE FILEPATH "The path to freetype shared library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
|
||||||
find_library (3RDPARTY_FREETYPE_DLL freetype
|
|
||||||
PATHS "${3RDPARTY_FREETYPE_DIR}"
|
|
||||||
PATH_SUFFIXES bin
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_FREETYPE_DLL freetype
|
|
||||||
PATH_SUFFIXES bin)
|
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
# return ENV{FREETYPE_DIR}
|
||||||
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
|
SET (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
|
||||||
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE PATH "The directory containing freetype shared library" FORCE)
|
|
||||||
|
|
||||||
|
# freetype2 header
|
||||||
|
if (FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||||
|
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${FREETYPE_INCLUDE_DIR_freetype2}" CACHE FILEPATH "the path of freetype2" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
|
||||||
|
elseif (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||||
|
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_DIR_TMP "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
||||||
|
if (NOT "${3RDPARTY_FREETYPE_LIBRARY_DIR}" STREQUAL "${3RDPARTY_FREETYPE_LIBRARY_DIR_TMP}")
|
||||||
|
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_DLL_DIR)
|
||||||
|
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
||||||
|
elseif (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||||
|
get_filename_component(3RDPARTY_FREETYPE_DLL_DIR_TMP "${3RDPARTY_FREETYPE_DLL}" PATH)
|
||||||
|
if (NOT "${3RDPARTY_FREETYPE_DLL_DIR}" STREQUAL "${3RDPARTY_FREETYPE_DLL_DIR_TMP}")
|
||||||
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (3RDPARTY_FREETYPE_DLL_DIR OR EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
# freetype library
|
||||||
|
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_LIBRARY)
|
||||||
|
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "freetype library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||||
|
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
||||||
|
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE FILEPATH "The directory containing freetype library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||||
|
get_filename_component (FREETYPE_LIBRARY_PARENT_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" PATH) # parent of the library directory
|
||||||
|
|
||||||
|
set (3RDPARTY_FREETYPE_DLL "3RDPARTY_FREETYPE_DLL-NOTFOUND" CACHE FILEPATH "freetype shared library" FORCE)
|
||||||
|
find_library (3RDPARTY_FREETYPE_DLL freetype PATHS "${FREETYPE_LIBRARY_PARENT_DIR}/bin" NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||||
|
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
|
||||||
|
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE FILEPATH "The directory containing freetype shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
||||||
|
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT 3RDPARTY_FREETYPE_DLL_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
||||||
|
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing shared freetype library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# include found paths to common variables
|
||||||
|
if (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||||
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
||||||
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||||
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
||||||
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (3RDPARTY_FREETYPE_LIBRARY)
|
||||||
|
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
||||||
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if (3RDPARTY_FREETYPE_DLL OR EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_DLL_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_DLL_DIR)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# install instructions
|
|
||||||
if (INSTALL_FREETYPE)
|
if (INSTALL_FREETYPE)
|
||||||
|
|
||||||
OCCT_MAKE_OS_WITH_BITNESS()
|
OCCT_MAKE_OS_WITH_BITNESS()
|
||||||
@@ -302,21 +220,21 @@ if (INSTALL_FREETYPE)
|
|||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
else()
|
else()
|
||||||
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_ABS ${3RDPARTY_FREETYPE_LIBRARY} REALPATH)
|
get_filename_component(ABS_PATH ${3RDPARTY_FREETYPE_LIBRARY} REALPATH)
|
||||||
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_NAME ${3RDPARTY_FREETYPE_LIBRARY} NAME)
|
get_filename_component(FREETYPELIB ${3RDPARTY_FREETYPE_LIBRARY} NAME)
|
||||||
|
|
||||||
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
|
install (FILES "${ABS_PATH}"
|
||||||
CONFIGURATIONS Release
|
CONFIGURATIONS Release
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||||
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
|
RENAME ${FREETYPELIB}.6)
|
||||||
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
|
install (FILES "${ABS_PATH}"
|
||||||
CONFIGURATIONS RelWithDebInfo
|
CONFIGURATIONS RelWithDebInfo
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||||
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
|
RENAME ${FREETYPELIB}.6)
|
||||||
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
|
install (FILES "${ABS_PATH}"
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||||
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
|
RENAME ${FREETYPELIB}.6)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (USED_3RDPARTY_FREETYPE_DIR "")
|
set (USED_3RDPARTY_FREETYPE_DIR "")
|
||||||
@@ -334,4 +252,4 @@ OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
|
|||||||
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
|
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
|
||||||
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
|
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
|
||||||
|
|
||||||
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)
|
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)
|
@@ -1,122 +0,0 @@
|
|||||||
# CSF variables definition
|
|
||||||
|
|
||||||
if(CSFS_ALREADY_INCLUDED)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(CSFS_ALREADY_INCLUDED 1)
|
|
||||||
|
|
||||||
|
|
||||||
if (NOT DEFINED USE_TCL)
|
|
||||||
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_TCL)
|
|
||||||
if ("${3RDPARTY_TCL_LIBRARY_VERSION}" STREQUAL "")
|
|
||||||
message (STATUS "Warning. TCL version has not been specified by CSF_TclLibs defining thus it will be used as 8.6")
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_VERSION "8.6")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if ("${3RDPARTY_TK_LIBRARY_VERSION}" STREQUAL "")
|
|
||||||
message (STATUS "Warning. TK version has not been specified by CSF_TclTkLibs defining thus it will be used as 8.6")
|
|
||||||
set (3RDPARTY_TK_LIBRARY_VERSION "8.6")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_VTK AND NOT 3RDPARTY_VTK_REQUIRED_LIBRARIES)
|
|
||||||
message (WARNING "CSF_VTK specification: VTK libraries are not defined")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_TBB)
|
|
||||||
set (CSF_TBB "tbb tbbmalloc")
|
|
||||||
else()
|
|
||||||
set (CSF_TBB)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
set (CSF_advapi32 "advapi32.lib")
|
|
||||||
set (CSF_gdi32 "gdi32.lib")
|
|
||||||
set (CSF_user32 "user32.lib")
|
|
||||||
set (CSF_wsock32 "wsock32.lib")
|
|
||||||
set (CSF_AviLibs "ws2_32.lib vfw32.lib")
|
|
||||||
set (CSF_OpenGlLibs "opengl32.lib glu32.lib")
|
|
||||||
|
|
||||||
if (USE_TCL)
|
|
||||||
set (CSF_TclLibs "tcl${3RDPARTY_TCL_LIBRARY_VERSION}.lib")
|
|
||||||
set (CSF_TclTkLibs "tk${3RDPARTY_TK_LIBRARY_VERSION}.lib")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_VTK)
|
|
||||||
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
|
|
||||||
else()
|
|
||||||
set (CSF_VTK)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
set (CSF_objc "objc")
|
|
||||||
|
|
||||||
# frameworks
|
|
||||||
find_library (Appkit_LIB NAMES Appkit)
|
|
||||||
set (CSF_Appkit ${Appkit_LIB})
|
|
||||||
|
|
||||||
find_library (IOKit_LIB NAMES IOKit)
|
|
||||||
set (CSF_IOKit ${IOKit_LIB})
|
|
||||||
|
|
||||||
OCCT_CHECK_AND_UNSET (Appkit_LIB)
|
|
||||||
OCCT_CHECK_AND_UNSET (IOKit_LIB)
|
|
||||||
|
|
||||||
if (USE_GLX)
|
|
||||||
set (CSF_OpenGlLibs GL)
|
|
||||||
set (CSF_XwLibs "X11 Xext Xmu Xi")
|
|
||||||
else()
|
|
||||||
find_library (OpenGlLibs_LIB NAMES OpenGL)
|
|
||||||
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
|
|
||||||
|
|
||||||
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_TCL)
|
|
||||||
set (CSF_TclTkLibs Tk)
|
|
||||||
set (CSF_TclLibs Tcl)
|
|
||||||
endif()
|
|
||||||
elseif (ANDROID)
|
|
||||||
set (CSF_ThreadLibs "c")
|
|
||||||
set (CSF_OpenGlLibs "EGL GLESv2")
|
|
||||||
elseif (UNIX)
|
|
||||||
set (CSF_ThreadLibs "pthread rt")
|
|
||||||
set (CSF_OpenGlLibs "GLU GL")
|
|
||||||
set (CSF_XwLibs "X11 Xext Xmu Xi")
|
|
||||||
|
|
||||||
if (USE_TCL)
|
|
||||||
set (CSF_TclLibs "tcl${3RDPARTY_TCL_LIBRARY_VERSION}")
|
|
||||||
set (CSF_TclTkLibs "tk${3RDPARTY_TK_LIBRARY_VERSION}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_FREETYPE)
|
|
||||||
set (CSF_FREETYPE "freetype")
|
|
||||||
else()
|
|
||||||
set (CSF_FREETYPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_FREEIMAGE)
|
|
||||||
set (CSF_FreeImagePlus "freeimage")
|
|
||||||
else()
|
|
||||||
set (CSF_FreeImagePlus)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT DEFINED ANDROID)
|
|
||||||
if (USE_GL2PS)
|
|
||||||
set (CSF_GL2PS "gl2ps")
|
|
||||||
else()
|
|
||||||
set (CSF_GL2PS)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_VTK)
|
|
||||||
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
|
|
||||||
else()
|
|
||||||
set (CSF_VTK)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
@@ -1,10 +1,3 @@
|
|||||||
##
|
|
||||||
|
|
||||||
if(FLAGS_ALREADY_INCLUDED)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(FLAGS_ALREADY_INCLUDED 1)
|
|
||||||
|
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_definitions(/fp:precise)
|
add_definitions(/fp:precise)
|
||||||
@@ -82,26 +75,20 @@ endif()
|
|||||||
# generate a single response file which enlist all of the object files
|
# generate a single response file which enlist all of the object files
|
||||||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||||
# increase compiler warnings level (-W4 for MSVC, -Wextra for GCC)
|
# increase compiler warnings level (-W4 for MSVC, -Wall for GCC)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||||
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
else()
|
else()
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||||
endif()
|
endif()
|
||||||
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED CMAKE_COMPILER_IS_GNUCXX OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
|
if (DEFINED CMAKE_COMPILER_IS_GNUCXX OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
|
||||||
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
|
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Optimize size of binaries
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
|
||||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
@@ -1,11 +1,4 @@
|
|||||||
##
|
#
|
||||||
|
|
||||||
if(OCCT_MACROS_ALREADY_INCLUDED)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(OCCT_MACROS_ALREADY_INCLUDED 1)
|
|
||||||
|
|
||||||
|
|
||||||
macro (OCCT_CHECK_AND_UNSET VARNAME)
|
macro (OCCT_CHECK_AND_UNSET VARNAME)
|
||||||
if (DEFINED ${VARNAME})
|
if (DEFINED ${VARNAME})
|
||||||
unset (${VARNAME} CACHE)
|
unset (${VARNAME} CACHE)
|
||||||
@@ -98,14 +91,15 @@ function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
|
|||||||
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
|
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
|
||||||
foreach (ORIGIN_FILE ${ORIGIN_FILES})
|
foreach (ORIGIN_FILE ${ORIGIN_FILES})
|
||||||
# check for existence of patched version of current file
|
# check for existence of patched version of current file
|
||||||
if (NOT APPLY_OCCT_PATCH_DIR OR NOT EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}")
|
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}")
|
||||||
list (APPEND FOUND_FILES ${ORIGIN_FILE})
|
|
||||||
else()
|
|
||||||
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
|
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
|
||||||
if (NOT EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
|
if (EXISTS "${APPLY_OCCT_PATCH_DIR}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
|
||||||
list (APPEND FOUND_FILES ${ORIGIN_FILE})
|
continue()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# append origin version if patched one is not found
|
||||||
|
list (APPEND FOUND_FILES ${ORIGIN_FILE})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
|
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
|
||||||
@@ -117,11 +111,11 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
|||||||
|
|
||||||
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
|
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
|
||||||
|
|
||||||
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
|
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||||
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||||
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
|
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
|
||||||
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
|
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+")
|
||||||
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
|
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}")
|
||||||
|
|
||||||
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
|
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
|
||||||
|
|
||||||
@@ -141,7 +135,9 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if (LOCAL_RESULT)
|
if (LOCAL_RESULT)
|
||||||
list (GET LOCAL_RESULT -1 DUMMY)
|
list (LENGTH "${LOCAL_RESULT}" LOC_LEN)
|
||||||
|
math (EXPR LAST_ELEMENT_INDEX "${LOC_LEN}-1")
|
||||||
|
list (GET LOCAL_RESULT ${LAST_ELEMENT_INDEX} DUMMY)
|
||||||
set (${RESULT} ${DUMMY} PARENT_SCOPE)
|
set (${RESULT} ${DUMMY} PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
@@ -177,7 +173,7 @@ macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS)
|
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS)
|
||||||
set (OCCT_USED_PACKAGES)
|
set (OCCT_SOURCE_DIRS)
|
||||||
|
|
||||||
# consider patched header.in template
|
# consider patched header.in template
|
||||||
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
|
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
|
||||||
@@ -188,124 +184,43 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
|||||||
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
|
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
|
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
|
||||||
|
# append parent folder
|
||||||
|
list (APPEND OCCT_SOURCE_DIRS ${OCCT_USED_TOOLKIT})
|
||||||
|
|
||||||
# append all required package folders
|
# append all required package folders
|
||||||
set (OCCT_TOOLKIT_PACKAGES)
|
set (OCCT_USED_TOOLKIT_DEPS)
|
||||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
|
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_USED_TOOLKIT_DEPS)
|
||||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_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)
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_USED_TOOLKIT_DEPS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
|
foreach (OCCT_USED_TOOLKIT_DEP ${OCCT_USED_TOOLKIT_DEPS})
|
||||||
|
list (APPEND OCCT_SOURCE_DIRS ${OCCT_USED_TOOLKIT_DEP})
|
||||||
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
|
foreach (OCCT_SOURCE_DIR ${OCCT_SOURCE_DIRS})
|
||||||
|
# get all header files from each src folder
|
||||||
|
file (GLOB OCCT_HEADER_FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_SOURCE_DIR}/*.[hgl]xx" "${CMAKE_SOURCE_DIR}/src/${OCCT_SOURCE_DIR}/*.h")
|
||||||
|
install (FILES ${OCCT_HEADER_FILES} DESTINATION "${INSTALL_DIR}/inc")
|
||||||
|
|
||||||
set (OCCT_HEADER_FILES_COMPLETE)
|
# create new file including found header
|
||||||
set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES)
|
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES})
|
||||||
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
|
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
|
||||||
|
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
# consider pathed the source files
|
||||||
message (STATUS "Info. \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
|
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}")
|
||||||
|
file (GLOB PATCHED_OCCT_HEADER_FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}/*.[hgl]xx" "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_SOURCE_DIR}/*.h")
|
||||||
|
install (FILES ${PATCHED_OCCT_HEADER_FILES} DESTINATION "${INSTALL_DIR}/inc")
|
||||||
|
|
||||||
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
|
# create new patched file including found header
|
||||||
if (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
foreach (OCCT_HEADER_FILE ${PATCHED_OCCT_HEADER_FILES})
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
|
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
|
||||||
|
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
|
||||||
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
|
|
||||||
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
|
|
||||||
|
|
||||||
# emit warnings if there is unprocessed headers
|
|
||||||
file (GLOB OCCT_ALL_FILES_IN_DIR "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/*.*")
|
|
||||||
foreach (OCCT_FILE_IN_DIR ${OCCT_ALL_FILES_IN_DIR})
|
|
||||||
get_filename_component (OCCT_FILE_IN_DIR_NAME ${OCCT_FILE_IN_DIR} NAME)
|
|
||||||
|
|
||||||
set (OCCT_FILE_IN_DIR_STATUS OFF)
|
|
||||||
|
|
||||||
if (${ALL_FILES_NB} LESS 0)
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
|
|
||||||
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
|
|
||||||
|
|
||||||
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
|
|
||||||
set (OCCT_FILE_IN_DIR_STATUS ON)
|
|
||||||
|
|
||||||
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
|
|
||||||
if (IS_HEADER_FOUND)
|
|
||||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
|
|
||||||
|
|
||||||
# collect header files with name that does not contain its package one
|
|
||||||
string (FIND "${OCCT_FILE_NAME}" "${OCCT_PACKAGE}_" FOUND_INDEX)
|
|
||||||
if (NOT ${FOUND_INDEX} EQUAL 0)
|
|
||||||
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# remove found element from list
|
|
||||||
list (REMOVE_AT OCCT_ALL_FILE_NAMES ${FILE_INDEX})
|
|
||||||
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" ) # decrement number
|
|
||||||
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if (NOT OCCT_FILE_IN_DIR_STATUS)
|
|
||||||
message (STATUS "Warning. ${OCCT_FILE_IN_DIR} is not involved into ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
|
||||||
|
|
||||||
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
|
|
||||||
if (IS_HEADER_FOUND)
|
|
||||||
list (APPEND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${OCCT_FILE_NAME})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
|
||||||
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# create new file including found header
|
|
||||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
|
||||||
message (STATUS "Info. \(${CURRENT_TIME}\) Create header-links in inc folder...")
|
|
||||||
|
|
||||||
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
|
|
||||||
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
|
|
||||||
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/inc")
|
|
||||||
|
|
||||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
|
||||||
message (STATUS "Info. \(${CURRENT_TIME}\) Checking headers in inc folder...")
|
|
||||||
|
|
||||||
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/inc/*")
|
|
||||||
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
|
|
||||||
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE_OLD} NAME)
|
|
||||||
string (REGEX MATCH "^[a-zA-Z0-9]+" PACKAGE_NAME "${HEADER_FILE_NAME}")
|
|
||||||
|
|
||||||
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
|
||||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
|
||||||
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()
|
|
||||||
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
|
||||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
|
||||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is presented in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
|
||||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set (IS_HEADER_FOUND -1)
|
|
||||||
if (NOT "${OCCT_HEADER_FILE_WITH_PROPER_NAMES}" STREQUAL "")
|
|
||||||
list (FIND OCCT_HEADER_FILE_WITH_PROPER_NAMES ${HEADER_FILE_NAME} IS_HEADER_FOUND)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${IS_HEADER_FOUND} EQUAL -1)
|
|
||||||
message (STATUS "Warning. \(${PACKAGE_NAME}\) ${OCCT_HEADER_FILE_OLD} is not used and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
|
||||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
@@ -481,22 +396,3 @@ function (OCCT_VERSION OCCT_VERSION_VAR)
|
|||||||
set (${OCCT_VERSION_VAR} "${OCCT_VERSION_LOCALVAR}" PARENT_SCOPE)
|
set (${OCCT_VERSION_VAR} "${OCCT_VERSION_LOCALVAR}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
|
|
||||||
|
|
||||||
set (THE_ROOT_PATH "${${THE_ROOT_PATH_NAME}}")
|
|
||||||
set (THE_BEING_CHECKED_PATH "${${THE_BEING_CHECKED_PATH_NAME}}")
|
|
||||||
|
|
||||||
if (THE_BEING_CHECKED_PATH OR EXISTS "${THE_BEING_CHECKED_PATH}")
|
|
||||||
get_filename_component (THE_ROOT_PATH_ABS "${THE_ROOT_PATH}" ABSOLUTE)
|
|
||||||
get_filename_component (THE_BEING_CHECKED_PATH_ABS "${THE_BEING_CHECKED_PATH}" ABSOLUTE)
|
|
||||||
|
|
||||||
string (REGEX MATCH "${THE_ROOT_PATH_ABS}" DOES_PATH_CONTAIN "${THE_BEING_CHECKED_PATH_ABS}")
|
|
||||||
|
|
||||||
if (NOT DOES_PATH_CONTAIN) # if cmake found the being checked path at different place from THE_ROOT_PATH_ABS
|
|
||||||
set (${THE_BEING_CHECKED_PATH_NAME} "" CACHE ${THE_VAR_TYPE} "${THE_MESSAGE_OF_BEING_CHECKED_PATH}" FORCE)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set (${THE_BEING_CHECKED_PATH_NAME} "" CACHE ${THE_VAR_TYPE} "${THE_MESSAGE_OF_BEING_CHECKED_PATH}" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endmacro()
|
|
||||||
|
@@ -1,204 +1,163 @@
|
|||||||
# script for each OCCT toolkit
|
# script for each OCCT toolkit
|
||||||
|
|
||||||
# parce PACKAGES file
|
|
||||||
if ("${PROJECT_NAME}" STREQUAL DRAWEXE)
|
|
||||||
set (USED_PACKAGES DRAWEXE)
|
|
||||||
else()
|
|
||||||
FILE_TO_LIST ("src/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (PRECOMPILED_DEFS)
|
|
||||||
|
|
||||||
# Get all used packages from toolkit
|
# Get all used packages from toolkit
|
||||||
foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
foreach (OCCT_PACKAGE ${TOOLKIT_MODULES})
|
||||||
|
if (WIN32)
|
||||||
# TKService contains platform-dependent packages: Xw and WNT
|
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE}_DLL")
|
||||||
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 (${REBUILD_PLATFORM_DEPENDENT_CODE})
|
|
||||||
|
|
||||||
# flex files
|
|
||||||
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
|
|
||||||
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
|
|
||||||
|
|
||||||
# bison files
|
|
||||||
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${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}/src/${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}/src/${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 (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES")
|
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
|
||||||
|
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
|
||||||
if(APPLE)
|
|
||||||
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
|
||||||
|
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
|
||||||
if(APPLE)
|
|
||||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${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 (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
list (APPEND USED_INCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
else()
|
|
||||||
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
|
||||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
list (APPEND USED_SRCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
else()
|
|
||||||
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
# ${OCCT_SOURCE_DIR}/src/${OCCT_PACKAGE}
|
||||||
|
|
||||||
|
set (SOURCE_FILES)
|
||||||
|
set (HEADER_FILES)
|
||||||
|
|
||||||
|
# Generate Flex and Bison files
|
||||||
|
if (${REBUILD_PLATFORM_DEPENDENT_CODE})
|
||||||
|
|
||||||
|
# flex files
|
||||||
|
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
|
||||||
|
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
|
||||||
|
list (SORT SOURCE_FILES_FLEX)
|
||||||
|
|
||||||
|
# bison files
|
||||||
|
OCCT_ORIGIN_AND_PATCHED_FILES ("src/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
|
||||||
|
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
|
||||||
|
list (SORT SOURCE_FILES_BISON)
|
||||||
|
|
||||||
|
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
|
||||||
|
|
||||||
|
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} ${CMP_DIR}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
|
||||||
|
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMP_DIR}/${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 (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||||
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||||
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||||
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||||
|
|
||||||
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||||
|
if(APPLE)
|
||||||
|
file (STRINGS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||||
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||||
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||||
|
|
||||||
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||||
|
if(APPLE)
|
||||||
|
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${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 (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
list (APPEND USED_INCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
else()
|
||||||
|
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||||
|
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
list (APPEND USED_SRCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
else()
|
||||||
|
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
|
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
|
||||||
|
|
||||||
if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
|
# Get from toolkits EXTERNLIB all used libs
|
||||||
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
|
OCCT_TOOLKIT_DEP (${PROJECT_NAME} ${PROJECT_NAME}_DEPS)
|
||||||
|
foreach (PROJECT_DEP ${${PROJECT_NAME}_DEPS})
|
||||||
|
IS_OCCT_TOOLKIT (${PROJECT_DEP} OCCT_MODULES FOUND_TOOLKIT)
|
||||||
|
if ("${FOUND_TOOLKIT}" STREQUAL "ON")
|
||||||
|
list (APPEND USED_LIBS "${PROJECT_DEP}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
install (TARGETS ${PROJECT_NAME}
|
# Create project for toolkit
|
||||||
CONFIGURATIONS Release
|
list (FIND BUILD_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
if ("${BUILD_TOOLKITS}" STREQUAL "" OR NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
|
||||||
install (TARGETS ${PROJECT_NAME}
|
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
|
||||||
install (TARGETS ${PROJECT_NAME}
|
|
||||||
CONFIGURATIONS Debug
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
|
||||||
else()
|
|
||||||
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
|
|
||||||
|
|
||||||
install (TARGETS ${PROJECT_NAME}
|
foreach (OCCT_MODULE ${OCCT_MODULES})
|
||||||
CONFIGURATIONS Release
|
list (FIND ${OCCT_MODULE}_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
|
||||||
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
|
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
|
||||||
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
set (CURRENT_MODULE ${OCCT_MODULE})
|
||||||
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
endif()
|
||||||
install (TARGETS ${PROJECT_NAME}
|
endforeach()
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini"
|
if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
|
||||||
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
|
||||||
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
|
||||||
install (TARGETS ${PROJECT_NAME}
|
install (TARGETS ${PROJECT_NAME}
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Release
|
||||||
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||||
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
install (TARGETS ${PROJECT_NAME}
|
||||||
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
CONFIGURATIONS RelWithDebInfo
|
||||||
if (MSVC)
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||||
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
|
install (TARGETS ${PROJECT_NAME}
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (CURRENT_MODULE)
|
|
||||||
foreach (OCCT_MODULE ${OCCT_MODULES})
|
|
||||||
list (FIND ${OCCT_MODULE}_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
|
|
||||||
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
|
|
||||||
set (CURRENT_MODULE ${OCCT_MODULE})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if (CURRENT_MODULE)
|
|
||||||
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
|
|
||||||
|
|
||||||
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
|
|
||||||
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
|
|
||||||
|
|
||||||
# parce EXTERNLIB file
|
|
||||||
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
|
||||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
|
||||||
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
|
|
||||||
if (NOT "${TK_FOUND}" STREQUAL "")
|
|
||||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
|
||||||
else()
|
else()
|
||||||
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
|
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES})
|
||||||
if ("${CSF_FOUND}" STREQUAL "")
|
|
||||||
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
|
install (TARGETS ${PROJECT_NAME}
|
||||||
else() # get CSF_ value
|
CONFIGURATIONS Release
|
||||||
set (CURRENT_CSF ${${USED_ITEM}})
|
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin"
|
||||||
if (NOT "${CURRENT_CSF}" STREQUAL "")
|
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||||
# prepare a list from a string with whitespaces
|
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||||
separate_arguments (CURRENT_CSF)
|
install (TARGETS ${PROJECT_NAME}
|
||||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
CONFIGURATIONS RelWithDebInfo
|
||||||
endif()
|
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini"
|
||||||
|
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||||
|
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||||
|
install (TARGETS ${PROJECT_NAME}
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind"
|
||||||
|
ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||||
|
LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||||
|
if (MSVC)
|
||||||
|
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if (APPLE)
|
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}")
|
||||||
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
|
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
|
||||||
if (NOT ${IS_X11_FOUND} EQUAL -1)
|
target_link_libraries (${PROJECT_NAME} ${USED_LIBS})
|
||||||
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
|
endif()
|
||||||
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()
|
|
||||||
|
|
||||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
|
@@ -9,6 +9,55 @@ if (NOT DEFINED 3RDPARTY_TBB_DIR)
|
|||||||
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
|
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# tbb include directory
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||||
|
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of the tbb")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb library file (with absolute path)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY OR NOT 3RDPARTY_TBB_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TBB_LIBRARY "" CACHE FILEPATH "tbb library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb library directory
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TBB_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb library")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb malloc library file (with absolute path)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY OR NOT 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TBBMALLOC_LIBRARY "" CACHE FILEPATH "tbb malloc library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb malloc library directory
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TBBMALLOC_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb malloc library")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb shared library (with absolute path)
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBB_DLL OR NOT 3RDPARTY_TBB_DLL_DIR)
|
||||||
|
set (3RDPARTY_TBB_DLL "" CACHE FILEPATH "tbb shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb shared library directory
|
||||||
|
if (WIN32 AND NOT DEFINED 3RDPARTY_TBB_DLL_DIR)
|
||||||
|
set (3RDPARTY_TBB_DLL_DIR "" CACHE FILEPATH "The directory containing tbb shared library")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb malloc shared library (with absolute path)
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TBBMALLOC_DLL OR NOT 3RDPARTY_TBBMALLOC_DLL_DIR)
|
||||||
|
set (3RDPARTY_TBBMALLOC_DLL "" CACHE FILEPATH "tbb malloc shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tbb malloc shared library directory
|
||||||
|
if (WIN32 AND NOT DEFINED 3RDPARTY_TBBMALLOC_DLL_DIR)
|
||||||
|
set (3RDPARTY_TBBMALLOC_DLL_DIR "" CACHE FILEPATH "The directory containing tbb malloc shared library")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
|
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
|
||||||
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
|
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
|
||||||
@@ -17,260 +66,184 @@ endif()
|
|||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||||
|
|
||||||
# specify TBB folder in connectin with 3RDPARTY_DIR
|
# search for product directory inside 3RDPARTY_DIR directory
|
||||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
if (NOT 3RDPARTY_TBB_DIR AND 3RDPARTY_DIR)
|
||||||
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_TBB_DIR PATH "The directory containing tbb")
|
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "TBB" TBB_DIR_NAME)
|
||||||
|
if (TBB_DIR_NAME)
|
||||||
|
message (STATUS "Info: TBB: ${TBB_DIR_NAME} folder is used")
|
||||||
|
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TBB_DIR OR NOT EXISTS "${3RDPARTY_TBB_DIR}")
|
OCCT_MAKE_COMPILER_BITNESS()
|
||||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
|
|
||||||
if (TBB_DIR_NAME)
|
if (${COMPILER_BITNESS} STREQUAL 32)
|
||||||
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
|
set (TBB_ARCH_NAME ia32)
|
||||||
|
else()
|
||||||
|
set (TBB_ARCH_NAME intel64)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# search for include directory in defined 3rdparty directory
|
||||||
|
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||||
|
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
|
||||||
|
find_path (3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include" NO_DEFAULT_PATH)
|
||||||
|
find_path (3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||||
|
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||||
|
|
||||||
|
# TBB_COMPILER_FOLER
|
||||||
|
#if (WIN32)
|
||||||
|
set (TBB_COMPILER_FOLER ${COMPILER})
|
||||||
|
#else()
|
||||||
|
# set (TBB_COMPILER_FOLER ${COMPILER})
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
# search for tbb and tbb malloc library in defined 3rdparty directory
|
||||||
|
foreach (LIBRARY_NAME TBB TBBMALLOC)
|
||||||
|
if (NOT WIN32)
|
||||||
|
file (GLOB TBB_SUBDIRS RELATIVE ${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/ ${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/*)
|
||||||
|
list (SORT TBB_SUBDIRS)
|
||||||
|
list (REVERSE TBB_SUBDIRS)
|
||||||
|
list (LENGTH TBB_SUBDIRS TBB_SUBDIRS_LENGTH)
|
||||||
|
set (TBB_SUBDIR_FIRST "")
|
||||||
|
if (${TBB_SUBDIRS_LENGTH})
|
||||||
|
list (GET TBB_SUBDIRS 0 TBB_SUBDIR_FIRST)
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_SUBDIR_FIRST}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
|
||||||
#set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing TBB" FORCE)
|
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
|
||||||
endif()
|
elseif (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||||
|
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
|
||||||
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
|
if (NOT "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP}")
|
||||||
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
|
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
# check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tbb.h
|
|
||||||
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
|
||||||
|
|
||||||
set (HEADER_NAMES tbb.h tbb/tbb.h)
|
|
||||||
|
|
||||||
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
|
|
||||||
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
|
|
||||||
PATHS ${3RDPARTY_TBB_DIR}
|
|
||||||
PATH_SUFFIXES include
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
|
|
||||||
PATH_SUFFIXES include
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "3RDPARTY_${LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of ${LIBRARY_NAME}" FORCE)
|
||||||
|
|
||||||
|
string (TOLOWER "${LIBRARY_NAME}" lower_LIBRARY_NAME)
|
||||||
|
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${lower_LIBRARY_NAME} PATHS
|
||||||
|
"${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}"
|
||||||
|
"${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
# second search if previous one do not find anything
|
||||||
|
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
|
||||||
|
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
|
||||||
|
endif()
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} library" FORCE)
|
||||||
|
|
||||||
|
# search for dll in defined 3rdparty directory (just for win case)
|
||||||
|
if (WIN32)
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
|
||||||
|
elseif (3RDPARTY_${LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||||
|
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
|
||||||
|
if (NOT "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP}")
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_DLL "3RDPARTY_${LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of ${LIBRARY_NAME}" FORCE)
|
||||||
|
|
||||||
|
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME} PATHS
|
||||||
|
"${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}"
|
||||||
|
"${3RDPARTY_TBB_DIR}/bin/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
# second search if previous one do not find anything
|
||||||
|
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}")
|
||||||
|
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
|
||||||
|
set (3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif() # end dll search
|
||||||
|
endforeach() # end tbb / tbbmalloc
|
||||||
|
|
||||||
|
# include found paths to common variables
|
||||||
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||||
|
|
||||||
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# common steps for tbb and tbbmalloc
|
foreach (LIBRARY_NAME TBB TBBMALLOC)
|
||||||
macro (TBB_PRODUCT_SEARCH PRODUCT_NAME)
|
if (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||||
|
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
|
||||||
string (TOLOWER ${PRODUCT_NAME} lower_PRODUCT_NAME)
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
|
||||||
# define required tbb/tbbmalloc variables
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
if (3RDPARTY_${LIBRARY_NAME}_DLL OR EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}")
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32 AND NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_TBB_DIR
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY FILEPATH "the path to ${PRODUCT_NAME} library")
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
else()
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR PATH "The directory containing ${PRODUCT_NAME} library")
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_DLL FILEPATH "the path to ${PRODUCT_NAME} shared library")
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
else()
|
|
||||||
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR PATH "The directory containing ${PRODUCT_NAME} shared library")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
# install tbb
|
||||||
OCCT_MAKE_COMPILER_BITNESS()
|
|
||||||
|
|
||||||
if (${COMPILER_BITNESS} EQUAL 32)
|
|
||||||
set (${PRODUCT_NAME}_ARCH_NAME ia32)
|
|
||||||
else()
|
|
||||||
set (${PRODUCT_NAME}_ARCH_NAME intel64)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tbb/tbbmalloc library
|
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
|
|
||||||
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME})
|
|
||||||
|
|
||||||
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER}")
|
|
||||||
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}")
|
|
||||||
file (GLOB ${PRODUCT_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${PRODUCT_NAME}_ARCH_NAME}/*")
|
|
||||||
if (${PRODUCT_NAME}_COMPILER_LIST)
|
|
||||||
list (GET ${PRODUCT_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
|
|
||||||
if (THE_MOST_FRESH_COMPILER_VERSION)
|
|
||||||
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
|
|
||||||
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME} lib/${${PRODUCT_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set (PRODUCT_PATH_SUFFIXES lib ${lower_PRODUCT_NAME} lib/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${lower_PRODUCT_NAME}
|
|
||||||
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
|
|
||||||
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${lower_PRODUCT_NAME}
|
|
||||||
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
|
|
||||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
|
||||||
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tbb/tbbmalloc shared library
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
|
||||||
set (PRODUCT_PATH_SUFFIXES bin)
|
|
||||||
|
|
||||||
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER}")
|
|
||||||
if (EXISTS "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}")
|
|
||||||
file (GLOB ${PRODUCT_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/bin/${${PRODUCT_NAME}_ARCH_NAME}/*")
|
|
||||||
if (${PRODUCT_NAME}_COMPILER_LIST)
|
|
||||||
list (GET ${PRODUCT_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
|
|
||||||
if (THE_MOST_FRESH_COMPILER_VERSION)
|
|
||||||
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
|
|
||||||
set (PRODUCT_PATH_SUFFIXES bin bin/${${PRODUCT_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set (PRODUCT_PATH_SUFFIXES bin bin/${${PRODUCT_NAME}_ARCH_NAME}/${COMPILER})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL ${lower_PRODUCT_NAME}
|
|
||||||
PATHS "${3RDPARTY_TBB_DIR}"
|
|
||||||
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL ${lower_PRODUCT_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
|
||||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
|
||||||
else()
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
|
|
||||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# install tbb/tbbmalloc
|
|
||||||
if (INSTALL_${PRODUCT_NAME})
|
|
||||||
OCCT_MAKE_OS_WITH_BITNESS()
|
|
||||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
|
|
||||||
CONFIGURATIONS Release
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
|
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
|
|
||||||
CONFIGURATIONS Debug
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
|
||||||
else()
|
|
||||||
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME)
|
|
||||||
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
|
|
||||||
CONFIGURATIONS Release
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
|
||||||
RENAME ${PRODUCT_LIBRARY_NAME}.2)
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
|
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
|
||||||
RENAME ${PRODUCT_LIBRARY_NAME}.2)
|
|
||||||
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
|
|
||||||
CONFIGURATIONS Debug
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
|
||||||
RENAME ${PRODUCT_LIBRARY_NAME}.2)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
|
|
||||||
TBB_PRODUCT_SEARCH (TBB)
|
|
||||||
TBB_PRODUCT_SEARCH (TBBMALLOC)
|
|
||||||
|
|
||||||
|
|
||||||
if (INSTALL_TBB)
|
if (INSTALL_TBB)
|
||||||
|
OCCT_MAKE_OS_WITH_BITNESS()
|
||||||
|
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||||
|
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||||
|
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL}
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
|
else()
|
||||||
|
get_filename_component(TBBLIB ${3RDPARTY_TBB_LIBRARY} NAME)
|
||||||
|
get_filename_component(TBBMALLOCLIB ${3RDPARTY_TBBMALLOC_LIBRARY} NAME)
|
||||||
|
|
||||||
|
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||||
|
RENAME ${TBBLIB}.2)
|
||||||
|
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||||
|
RENAME ${TBBLIB}.2)
|
||||||
|
install (FILES ${3RDPARTY_TBB_LIBRARY}.2
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||||
|
RENAME ${TBBLIB}.2)
|
||||||
|
|
||||||
|
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||||
|
RENAME ${TBBMALLOCLIB}.2)
|
||||||
|
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||||
|
RENAME ${TBBMALLOCLIB}.2)
|
||||||
|
install (FILES ${3RDPARTY_TBBMALLOC_LIBRARY}.2
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||||
|
RENAME ${TBBMALLOCLIB}.2)
|
||||||
|
endif()
|
||||||
|
|
||||||
set (USED_3RDPARTY_TBB_DIR "")
|
set (USED_3RDPARTY_TBB_DIR "")
|
||||||
else()
|
else()
|
||||||
# the library directory for using by the executable
|
# the library directory for using by the executable
|
||||||
@@ -280,3 +253,5 @@ else()
|
|||||||
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
|
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced (3RDPARTY_TBB_LIBRARY 3RDPARTY_TBBMALLOC_LIBRARY 3RDPARTY_TBB_DLL 3RDPARTY_TBBMALLOC_DLL)
|
||||||
|
@@ -14,6 +14,11 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
|
|||||||
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# tk include directory
|
||||||
|
if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
||||||
|
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
||||||
|
endif()
|
||||||
|
|
||||||
# tcl library file (with absolute path)
|
# tcl library file (with absolute path)
|
||||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
|
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
|
||||||
@@ -24,6 +29,16 @@ if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
|
|||||||
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# tk library file (with absolute path)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tk library directory
|
||||||
|
if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
|
||||||
|
set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
|
||||||
|
endif()
|
||||||
|
|
||||||
# tcl shared library (with absolute path)
|
# tcl shared library (with absolute path)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
||||||
@@ -36,6 +51,18 @@ if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
|
|||||||
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# tk shared library (with absolute path)
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
|
||||||
|
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tk shared library directory
|
||||||
|
if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
|
||||||
|
set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk shared library")
|
||||||
|
endif()
|
||||||
|
|
||||||
# search for tcl in user defined directory
|
# search for tcl in user defined directory
|
||||||
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
|
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
|
||||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
|
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
|
||||||
@@ -49,148 +76,226 @@ if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
|||||||
set (TCL_INCLUDE_PATH "${3RDPARTY_TCL_DIR}/include")
|
set (TCL_INCLUDE_PATH "${3RDPARTY_TCL_DIR}/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# check tcl include dir, library dir and shared library dir
|
# check tcl/tk include dir, library dir and shared library dir
|
||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
macro (DIR_SUBDIR_FILE_FIT LIBNAME)
|
||||||
|
if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
||||||
|
# tcl/tk include dir
|
||||||
|
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||||
|
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||||
|
if (NOT DOES_PATH_CONTAIN)
|
||||||
|
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tcl/tk library dir
|
||||||
|
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||||
|
|
||||||
|
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||||
|
if (NOT DOES_PATH_CONTAIN)
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# tcl/tk shared library dir
|
||||||
|
if (WIN32)
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
if (NOT DOES_PATH_CONTAIN)
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# check tcl/tk library
|
||||||
|
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||||
|
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||||
|
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||||
|
|
||||||
|
if (NOT DOES_PATH_CONTAIN)
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# check tcl/tk shared library
|
||||||
|
if (WIN32)
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||||
|
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
|
||||||
|
|
||||||
|
if (NOT DOES_PATH_CONTAIN)
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
DIR_SUBDIR_FILE_FIT(TCL)
|
||||||
|
DIR_SUBDIR_FILE_FIT(TK)
|
||||||
|
|
||||||
|
|
||||||
# use default (CMake) TCL search
|
# use default (CMake) TCL search
|
||||||
find_package(TCL)
|
find_package(TCL)
|
||||||
|
|
||||||
# tcl include dir
|
foreach (LIBNAME TCL TK)
|
||||||
if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
|
string (TOLOWER "${LIBNAME}" LIBNAME_L)
|
||||||
if (TCL_INCLUDE_PATH AND EXISTS "${TCL_INCLUDE_PATH}")
|
|
||||||
set (3RDPARTY_TCL_INCLUDE_DIR "${TCL_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of TCL" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tcl dir and library
|
# tcl/tk include dir
|
||||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
if (NOT 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||||
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
|
if (${LIBNAME}_INCLUDE_PATH AND EXISTS "${${LIBNAME}_INCLUDE_PATH}")
|
||||||
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
|
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "${${LIBNAME}_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
|
||||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
|
# tcl/tk dir and library
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||||
|
if (${LIBNAME}_LIBRARY AND EXISTS "${${LIBNAME}_LIBRARY}")
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY "${${LIBNAME}_LIBRARY}" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
|
||||||
if (WIN32)
|
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR)
|
||||||
if (NOT 3RDPARTY_TCL_DLL)
|
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
|
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
set (DLL_FOLDER_FOR_SEARCH "")
|
|
||||||
if (3RDPARTY_TCL_DLL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
|
||||||
elseif (3RDPARTY_TCL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
|
||||||
elseif (3RDPARTY_TCL_LIBRARY_DIR)
|
|
||||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
|
||||||
find_library (3RDPARTY_TCL_DLL NAMES tcl86 tcl85
|
|
||||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
|
||||||
|
|
||||||
# tcl dir and library
|
|
||||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
|
||||||
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
|
|
||||||
find_library (3RDPARTY_TCL_LIBRARY NAMES tcl8.6 tcl86 tcl8.5 tcl85
|
|
||||||
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
# search in another place if previous search doesn't find anything
|
|
||||||
find_library (3RDPARTY_TCL_LIBRARY NAMES tcl8.6 tcl86 tcl8.5 tcl85
|
|
||||||
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
|
||||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
|
|
||||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_VERSION "")
|
|
||||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
|
||||||
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
|
|
||||||
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
|
|
||||||
|
|
||||||
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
|
|
||||||
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
|
||||||
message (STATUS "Info: TCL version isn't found")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
|
|
||||||
if (3RDPARTY_TCL_LIBRARY_VERSION)
|
|
||||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
|
||||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
|
||||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT 3RDPARTY_TCL_DLL)
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
|
|
||||||
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "")
|
|
||||||
if (3RDPARTY_TCL_DLL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
|
||||||
elseif (3RDPARTY_TCL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
|
||||||
else()
|
|
||||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
|
||||||
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
|
|
||||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
|
|
||||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
|
|
||||||
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
|
||||||
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
|
if (WIN32)
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
|
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
elseif (3RDPARTY_TCL_DIR)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||||
|
elseif (3RDPARTY_${LIBNAME}_LIBRARY_DIR)
|
||||||
|
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}86 ${LIBNAME_L}85
|
||||||
|
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
# include found paths to common variables
|
DIR_SUBDIR_FILE_FIT(${LIBNAME})
|
||||||
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_LIBRARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
# tcl/tk dir and library
|
||||||
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
|
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
|
set (3RDPARTY_${LIBNAME}_LIBRARY "3RDPARTY_${LIBNAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||||
|
PATHS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
# search in another place if previous search doesn't find anything
|
||||||
|
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||||
|
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR AND 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||||
|
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "")
|
||||||
|
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||||
|
get_filename_component (${LIBNAME}_LIBRARY_NAME "${3RDPARTY_${LIBNAME}_LIBRARY}" NAME)
|
||||||
|
string(REGEX REPLACE "^.*${LIBNAME_L}([0-9]\\.*[0-9]).*$" "\\1" ${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_NAME}")
|
||||||
|
|
||||||
|
if (NOT "${${LIBNAME}_LIBRARY_VERSION}" STREQUAL "${${LIBNAME}_LIBRARY_NAME}")
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_VERSION}")
|
||||||
|
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
||||||
|
message (STATUS "Info: ${LIBNAME} version isn't found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "")
|
||||||
|
if (3RDPARTY_${LIBNAME}_LIBRARY_VERSION)
|
||||||
|
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_${LIBNAME}_MAJOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||||
|
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_${LIBNAME}_MINOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||||
|
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_${LIBNAME}_MAJOR_VERSION}.${3RDPARTY_${LIBNAME}_MINOR_VERSION}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
|
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
elseif (3RDPARTY_TCL_DIR)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||||
|
else()
|
||||||
|
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||||
|
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}
|
||||||
|
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT 3RDPARTY_${LIBNAME}_DLL_DIR AND 3RDPARTY_${LIBNAME}_DLL)
|
||||||
|
get_filename_component (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL}" PATH)
|
||||||
|
set (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# include found paths to common variables
|
||||||
|
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||||
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_DLL_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
# install tcl
|
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||||
|
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||||
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_LIBRARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
if (3RDPARTY_${LIBNAME}_DLL OR EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||||
|
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||||
|
else()
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# install tcltk
|
||||||
if (INSTALL_TCL)
|
if (INSTALL_TCL)
|
||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||||
@@ -201,15 +306,16 @@ if (INSTALL_TCL)
|
|||||||
if (WIN32)
|
if (WIN32)
|
||||||
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
|
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
|
||||||
|
|
||||||
# collect and install all dlls from tcl dll dirs
|
# collect and install all dlls from tcl/tk dll dirs
|
||||||
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
|
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
|
||||||
install (FILES ${TCL_DLLS}
|
file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll")
|
||||||
|
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||||
CONFIGURATIONS Release
|
CONFIGURATIONS Release
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||||
install (FILES ${TCL_DLLS}
|
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||||
CONFIGURATIONS RelWithDebInfo
|
CONFIGURATIONS RelWithDebInfo
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||||
install (FILES ${TCL_DLLS}
|
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
else()
|
else()
|
||||||
@@ -223,14 +329,26 @@ if (INSTALL_TCL)
|
|||||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||||
|
|
||||||
|
get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
|
||||||
|
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||||
|
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||||
|
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (TCL_TCLSH_VERSION)
|
if (TCL_TCLSH_VERSION)
|
||||||
# tcl is required to install in lib folder (without)
|
# tcl is required to install in lib folder (without)
|
||||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||||
|
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||||
else()
|
else()
|
||||||
message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.")
|
message (STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
|
||||||
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -244,20 +362,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
|
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TK_LIBRARY 3RDPARTY_TCL_DLL 3RDPARTY_TK_DLL)
|
||||||
|
|
||||||
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
|
||||||
|
|
||||||
get_filename_component (TK_WISH_ABSOLUTE "${TK_WISH}" ABSOLUTE)
|
|
||||||
get_filename_component (3RDPARTY_TCL_DIR_ABSOLUTE "${3RDPARTY_TCL_DIR}" ABSOLUTE)
|
|
||||||
|
|
||||||
string (FIND "${TK_WISH_ABSOLUTE}" "${3RDPARTY_TCL_DIR_ABSOLUTE}" THE_SAME_FOLDER)
|
|
||||||
|
|
||||||
if (${THE_SAME_FOLDER} EQUAL 0)
|
|
||||||
set (3RDPARTY_TCLTK_DIR "${3RDPARTY_TCL_DIR}")
|
|
||||||
message (STATUS "Info. TK is used from TCL folder: ${3RDPARTY_TCLTK_DIR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# unset all redundant variables
|
# unset all redundant variables
|
||||||
#TCL
|
#TCL
|
||||||
|
@@ -1,260 +0,0 @@
|
|||||||
# tk
|
|
||||||
|
|
||||||
if (NOT DEFINED INSTALL_TK)
|
|
||||||
set (INSTALL_TK OFF CACHE BOOL "${INSTALL_TK_DESCR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk directory
|
|
||||||
if (NOT DEFINED 3RDPARTY_TK_DIR)
|
|
||||||
set (3RDPARTY_TK_DIR "" CACHE PATH "The directory containing tk")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TK_DIR AND 3RDPARTY_TCLTK_DIR)
|
|
||||||
set (3RDPARTY_TK_DIR "${3RDPARTY_TCLTK_DIR}" CACHE PATH "The directory containing tk" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk include directory
|
|
||||||
if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
|
||||||
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk library file (with absolute path)
|
|
||||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
|
||||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk library directory
|
|
||||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
|
|
||||||
set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk shared library (with absolute path)
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
|
|
||||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk shared library directory
|
|
||||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
|
|
||||||
set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk shared library")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# search for tk in user defined directory
|
|
||||||
if (NOT 3RDPARTY_TK_DIR AND 3RDPARTY_DIR)
|
|
||||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tk TK_DIR_NAME)
|
|
||||||
if (TK_DIR_NAME)
|
|
||||||
set (3RDPARTY_TK_DIR "${3RDPARTY_DIR}/${TK_DIR_NAME}" CACHE PATH "The directory containing tk" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# define paths for default engine
|
|
||||||
if (3RDPARTY_TK_DIR AND EXISTS "${3RDPARTY_TK_DIR}")
|
|
||||||
set (TK_INCLUDE_PATH "${3RDPARTY_TK_DIR}/include")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# check tk include dir, library dir and shared library dir
|
|
||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
|
||||||
|
|
||||||
# use default (CMake) TCL search
|
|
||||||
find_package(TCL)
|
|
||||||
|
|
||||||
# tk include dir
|
|
||||||
if (NOT 3RDPARTY_TK_INCLUDE_DIR)
|
|
||||||
if (TK_INCLUDE_PATH AND EXISTS "${TK_INCLUDE_PATH}")
|
|
||||||
set (3RDPARTY_TK_INCLUDE_DIR "${TK_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of TK" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# tk dir and library
|
|
||||||
if (NOT 3RDPARTY_TK_LIBRARY)
|
|
||||||
if (TK_LIBRARY AND EXISTS "${TK_LIBRARY}")
|
|
||||||
set (3RDPARTY_TK_LIBRARY "${TK_LIBRARY}" CACHE FILEPATH "TK library" FORCE)
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TK_LIBRARY_DIR)
|
|
||||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TK library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT 3RDPARTY_TK_DLL)
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
|
||||||
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "")
|
|
||||||
if (3RDPARTY_TK_DLL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DLL_DIR}")
|
|
||||||
elseif (3RDPARTY_TK_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DIR}/bin")
|
|
||||||
elseif (3RDPARTY_TK_LIBRARY_DIR)
|
|
||||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR_PARENT "${3RDPARTY_TK_LIBRARY_DIR}" PATH)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_LIBRARY_DIR_PARENT}/bin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TK_DLL "3RDPARTY_TK_DLL-NOTFOUND" CACHE FILEPATH "TK shared library" FORCE)
|
|
||||||
find_library (3RDPARTY_TK_DLL NAMES tk86 tk85
|
|
||||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
|
||||||
|
|
||||||
# tk dir and library
|
|
||||||
if (NOT 3RDPARTY_TK_LIBRARY)
|
|
||||||
set (3RDPARTY_TK_LIBRARY "3RDPARTY_TK_LIBRARY-NOTFOUND" CACHE FILEPATH "TK library" FORCE)
|
|
||||||
find_library (3RDPARTY_TK_LIBRARY NAMES tk8.6 tk86 tk8.5 tk85
|
|
||||||
PATHS "${3RDPARTY_TK_LIBRARY_DIR}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
# search in another place if previous search doesn't find anything
|
|
||||||
find_library (3RDPARTY_TK_LIBRARY NAMES tk8.6 tk86 tk8.5 tk85
|
|
||||||
PATHS "${3RDPARTY_TK_DIR}/lib"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TK_LIBRARY OR NOT EXISTS "${3RDPARTY_TK_LIBRARY}")
|
|
||||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "TK library" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TK_LIBRARY_DIR AND 3RDPARTY_TK_LIBRARY)
|
|
||||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY}" PATH)
|
|
||||||
set (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TK library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TK_LIBRARY_VERSION "")
|
|
||||||
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
|
|
||||||
get_filename_component (TK_LIBRARY_NAME "${3RDPARTY_TK_LIBRARY}" NAME)
|
|
||||||
string(REGEX REPLACE "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY_NAME}")
|
|
||||||
|
|
||||||
if (NOT "${TK_LIBRARY_VERSION}" STREQUAL "${TK_LIBRARY_NAME}")
|
|
||||||
set (3RDPARTY_TK_LIBRARY_VERSION "${TK_LIBRARY_VERSION}")
|
|
||||||
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
|
||||||
message (STATUS "Info: TK version isn't found")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT "")
|
|
||||||
if (3RDPARTY_TK_LIBRARY_VERSION)
|
|
||||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TK_MAJOR_VERSION "${3RDPARTY_TK_LIBRARY_VERSION}")
|
|
||||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TK_MINOR_VERSION "${3RDPARTY_TK_LIBRARY_VERSION}")
|
|
||||||
set (3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TK_MAJOR_VERSION}.${3RDPARTY_TK_MINOR_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
if (NOT 3RDPARTY_TK_DLL)
|
|
||||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
|
||||||
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "")
|
|
||||||
if (3RDPARTY_TK_DLL_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DLL_DIR}")
|
|
||||||
elseif (3RDPARTY_TK_DIR)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DIR}/bin")
|
|
||||||
else()
|
|
||||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR_PARENT "${3RDPARTY_TK_LIBRARY_DIR}" PATH)
|
|
||||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_LIBRARY_DIR_PARENT}/bin")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_TK_DLL "3RDPARTY_TK_DLL-NOTFOUND" CACHE FILEPATH "TK shared library" FORCE)
|
|
||||||
find_library (3RDPARTY_TK_DLL NAMES tk${3RDPARTY_TK_LIBRARY_VERSION}
|
|
||||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_TK_DLL OR NOT EXISTS "${3RDPARTY_TK_DLL}")
|
|
||||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "TK shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (NOT 3RDPARTY_TK_DLL_DIR AND 3RDPARTY_TK_DLL)
|
|
||||||
get_filename_component (3RDPARTY_TK_DLL_DIR "${3RDPARTY_TK_DLL}" PATH)
|
|
||||||
set (3RDPARTY_TK_DLL_DIR "${3RDPARTY_TK_DLL_DIR}" CACHE FILEPATH "The directory containing TK shared library" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include found paths to common variables
|
|
||||||
if (3RDPARTY_TK_INCLUDE_DIR AND EXISTS "${3RDPARTY_TK_INCLUDE_DIR}")
|
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TK_INCLUDE_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_INCLUDE_DIR)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TK_LIBRARY_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_LIBRARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
if (3RDPARTY_TK_DLL OR EXISTS "${3RDPARTY_TK_DLL}")
|
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TK_DLL_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_DLL_DIR)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# install tk
|
|
||||||
if (INSTALL_TK)
|
|
||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
|
||||||
|
|
||||||
OCCT_MAKE_OS_WITH_BITNESS()
|
|
||||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
# tk 8.6 requires zlib. install all dlls from tk bin folder that may contain zlib also
|
|
||||||
|
|
||||||
# collect and install all dlls from tk dll dirs
|
|
||||||
file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll")
|
|
||||||
install (FILES ${TK_DLLS}
|
|
||||||
CONFIGURATIONS Release
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
|
||||||
install (FILES ${TK_DLLS}
|
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
|
||||||
install (FILES ${TK_DLLS}
|
|
||||||
CONFIGURATIONS Debug
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
|
||||||
else()
|
|
||||||
get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
|
|
||||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
|
||||||
CONFIGURATIONS Release
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
|
||||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
|
||||||
CONFIGURATIONS RelWithDebInfo
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
|
||||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
|
||||||
CONFIGURATIONS Debug
|
|
||||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (TCL_TCLSH_VERSION)
|
|
||||||
# tk is required to install in lib folder (without)
|
|
||||||
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
|
||||||
else()
|
|
||||||
message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.")
|
|
||||||
message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (USED_3RDPARTY_TK_DIR "")
|
|
||||||
else()
|
|
||||||
# the library directory for using by the executable
|
|
||||||
if (WIN32)
|
|
||||||
set (USED_3RDPARTY_TK_DIR ${3RDPARTY_TK_DLL_DIR})
|
|
||||||
else()
|
|
||||||
set (USED_3RDPARTY_TK_DIR ${3RDPARTY_TK_LIBRARY_DIR})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced (3RDPARTY_TK_LIBRARY 3RDPARTY_TK_DLL)
|
|
||||||
|
|
||||||
# unset all redundant variables
|
|
||||||
#TCL
|
|
||||||
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
|
|
||||||
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
|
|
||||||
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
|
|
||||||
#TK
|
|
||||||
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
|
||||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
|
||||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
|
@@ -24,8 +24,8 @@ These include messages on internal errors and special cases encountered, timing
|
|||||||
|
|
||||||
# install variables
|
# install variables
|
||||||
set (INSTALL_DIR_DESCR
|
set (INSTALL_DIR_DESCR
|
||||||
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
|
"The place where built OCCT libraries, headers, test cases (INSTALL_OCCT_TEST_CASES variable),
|
||||||
samples (INSTALL_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_GL2PS, INSTALL_TBB and
|
samples (INSTALL_OCCT_SAMPLES_DESCR variable) and certain 3rdparties (INSTALL_GL2PS, INSTALL_TBB and
|
||||||
other similar variables) will be placed during the installation process (building INSTALL project)")
|
other similar variables) will be placed during the installation process (building INSTALL project)")
|
||||||
|
|
||||||
macro (INSTALL_MESSAGE INSTALL_TARGET_VARIABLE INSTALL_TARGET_STRING)
|
macro (INSTALL_MESSAGE INSTALL_TARGET_VARIABLE INSTALL_TARGET_STRING)
|
||||||
@@ -34,8 +34,8 @@ set (${INSTALL_TARGET_VARIABLE}_DESCR
|
|||||||
project) into the installation directory (INSTALL_DIR variable)")
|
project) into the installation directory (INSTALL_DIR variable)")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
|
INSTALL_MESSAGE (INSTALL_OCCT_SAMPLES "OCCT samples")
|
||||||
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
|
INSTALL_MESSAGE (INSTALL_OCCT_TEST_CASES "non-regression OCCT test scripts")
|
||||||
INSTALL_MESSAGE (INSTALL_DOC_OcctOverview "OCCT overview documentation (HTML format)")
|
INSTALL_MESSAGE (INSTALL_DOC_OcctOverview "OCCT overview documentation (HTML format)")
|
||||||
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
|
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_FREEIMAGEPLUS "FreeImagePlus binaries")
|
INSTALL_MESSAGE (INSTALL_FREEIMAGEPLUS "FreeImagePlus binaries")
|
||||||
@@ -43,8 +43,7 @@ INSTALL_MESSAGE (INSTALL_FREETYPE "FreeType binaries")
|
|||||||
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
|
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
|
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_TCL "TCL binaries")
|
INSTALL_MESSAGE (INSTALL_TCL "TCL binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_TK "TK binaries")
|
INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
|
||||||
#INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
|
|
||||||
|
|
||||||
# build variables
|
# build variables
|
||||||
macro (BUILD_MODULE_MESSAGE BUILD_MODULE_TARGET_VARIABLE BUILD_MODULE_TARGET_STRING)
|
macro (BUILD_MODULE_MESSAGE BUILD_MODULE_TARGET_VARIABLE BUILD_MODULE_TARGET_STRING)
|
||||||
|
@@ -1,207 +1,183 @@
|
|||||||
# vtk
|
# vtk
|
||||||
|
|
||||||
#if (NOT DEFINED INSTALL_VTK)
|
if (NOT DEFINED INSTALL_VTK)
|
||||||
# set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
|
set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
|
||||||
#endif()
|
endif()
|
||||||
|
|
||||||
# vtk directory
|
# vtk directory
|
||||||
if (NOT DEFINED 3RDPARTY_VTK_DIR)
|
if (NOT DEFINED 3RDPARTY_VTK_DIR)
|
||||||
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing VTK")
|
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing vtk")
|
||||||
endif()
|
|
||||||
|
|
||||||
set (3RDPARTY_VTK_REQUIRED_LIBRARIES vtkCommonCore
|
|
||||||
vtkCommonDataModel
|
|
||||||
vtkCommonExecutionModel
|
|
||||||
vtkCommonMath
|
|
||||||
vtkCommonTransforms
|
|
||||||
vtkRenderingCore
|
|
||||||
vtkRenderingFreeType
|
|
||||||
vtkRenderingFreeTypeOpenGL
|
|
||||||
vtkRenderingOpenGL
|
|
||||||
vtkFiltersGeneral
|
|
||||||
vtkIOCore
|
|
||||||
vtkIOImage
|
|
||||||
vtkImagingCore
|
|
||||||
vtkInteractionStyle)
|
|
||||||
|
|
||||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
|
||||||
|
|
||||||
# specify VTK folder in connectin with 3RDPARTY_DIR
|
|
||||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
|
||||||
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
|
|
||||||
|
|
||||||
if (NOT 3RDPARTY_VTK_DIR OR NOT EXISTS "${3RDPARTY_VTK_DIR}")
|
|
||||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" VTK VTK_DIR_NAME)
|
|
||||||
if (VTK_DIR_NAME)
|
|
||||||
set (3RDPARTY_VTK_DIR "${3RDPARTY_DIR}/${VTK_DIR_NAME}" CACHE PATH "The directory containing VTK" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
#set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing VTK" FORCE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# vtk include directory
|
# vtk include directory
|
||||||
if (NOT DEFINED 3RDPARTY_VTK_INCLUDE_DIR)
|
if (NOT DEFINED 3RDPARTY_VTK_INCLUDE_DIR)
|
||||||
set (3RDPARTY_VTK_INCLUDE_DIR "" CACHE PATH "The directory containing headers of VTK")
|
set (3RDPARTY_VTK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of vtk")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# vtk library directory
|
# vtk library directory
|
||||||
if (NOT DEFINED 3RDPARTY_VTK_LIBRARY_DIR)
|
if (NOT DEFINED 3RDPARTY_VTK_LIBRARY_DIR)
|
||||||
set (3RDPARTY_VTK_LIBRARY_DIR "" CACHE PATH "The directory containing VTK libraries")
|
set (3RDPARTY_VTK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing vtk library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# vtk dll directory
|
# vtk dll directory
|
||||||
if (WIN32 AND NOT DEFINED 3RDPARTY_VTK_DLL_DIR)
|
if (WIN32 AND NOT DEFINED 3RDPARTY_VTK_DLL_DIR)
|
||||||
set (3RDPARTY_VTK_DLL_DIR "" CACHE PATH "The directory containing VTK shared libraries")
|
set (3RDPARTY_VTK_DLL_DIR "" CACHE FILEPATH "The directory containing VTK dll")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# check 3RDPARTY_VTK_ paths for consistency with specified 3RDPARTY_VTK_DIR
|
# search for vtk in user defined directory
|
||||||
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
if (NOT 3RDPARTY_VTK_DIR AND 3RDPARTY_DIR)
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_INCLUDE_DIR PATH "The directory containing headers of VTK")
|
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" vtk VTK_DIR_NAME)
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_LIBRARY_DIR PATH "The directory containing VTK libraries")
|
if (VTK_DIR_NAME)
|
||||||
|
set (3RDPARTY_VTK_DIR "${3RDPARTY_DIR}/${VTK_DIR_NAME}" CACHE PATH "The directory containing vtk product" FORCE)
|
||||||
if (WIN32)
|
|
||||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_VTK_DIR 3RDPARTY_VTK_DLL_DIR PATH "The directory containing VTK shared library")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
# find installed vtk
|
||||||
set (CACHED_VTK_DIR $ENV{VTK_DIR})
|
|
||||||
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(VTK QUIET)
|
find_package(VTK QUIET)
|
||||||
|
|
||||||
|
# find native vtk
|
||||||
|
if (NOT VTK_FOUND)
|
||||||
|
find_package(VTK QUIET PATHS "${3RDPARTY_VTK_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT VTK_FOUND AND NOT 3RDPARTY_VTK_DIR OR NOT EXISTS "${3RDPARTY_VTK_DIR}")
|
||||||
|
message(SEND_ERROR "VTK not found. Set the 3RDPARTY_VTK_DIR cmake cache entry to the directory containing VTK.")
|
||||||
|
set (3RDPARTY_VTK_DIR "3RDPARTY_VTK_DIR-NOTFOUND" CACHE PATH "The directory containing vtk product" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(VTK_VERSION "")
|
||||||
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
||||||
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
|
get_filename_component(3RDPARTY_VTK_DIR_NAME "${3RDPARTY_VTK_DIR}" NAME)
|
||||||
endif()
|
string(REGEX MATCH "^VTK-([0-9].[0-9])" VTK_VERSION "${3RDPARTY_VTK_DIR_NAME}")
|
||||||
|
set(VTK_VERSION "${CMAKE_MATCH_1}")
|
||||||
if (VTK_FOUND)
|
if (NOT 3RDPARTY_VTK_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||||
|
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_DIR}/include/vtk-${VTK_VERSION}" CACHE FILEPATH "The directory containing includes of VTK" FORCE)
|
||||||
# add compiler flags, preprocessor definitions, include and link dirs
|
|
||||||
include (${VTK_USE_FILE})
|
|
||||||
|
|
||||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND ON)
|
|
||||||
if (VTK_LIBRARIES)
|
|
||||||
|
|
||||||
set (3RDPARTY_VTK_INCLUDE_DIRS)
|
|
||||||
set (3RDPARTY_VTK_LIBRARY_DIRS)
|
|
||||||
set (3RDPARTY_VTK_DLL_DIRS)
|
|
||||||
|
|
||||||
foreach (VTK_REQUIRED_LIBRARY ${3RDPARTY_VTK_REQUIRED_LIBRARIES})
|
|
||||||
list (FIND VTK_LIBRARIES ${VTK_REQUIRED_LIBRARY} FOUND_INDEX)
|
|
||||||
if (${FOUND_INDEX} EQUAL -1)
|
|
||||||
message (WARNING "VTK: required ${VTK_REQUIRED_LIBRARY} library is not found")
|
|
||||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
|
|
||||||
else()
|
|
||||||
# get paths from corresponding variables
|
|
||||||
if (${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
|
|
||||||
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
|
|
||||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
|
||||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
|
||||||
if (NOT WIN32)
|
|
||||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# get paths from corresponding properties
|
|
||||||
get_property (TARGET_VTK_IMPORT_CONFS TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_CONFIGURATIONS)
|
|
||||||
|
|
||||||
if (TARGET_VTK_IMPORT_CONFS)
|
|
||||||
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
|
||||||
|
|
||||||
# todo: choose configuration in connection with the build type
|
|
||||||
#if (CMAKE_BUILD_TYPE)
|
|
||||||
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
|
|
||||||
# endforeach()
|
|
||||||
#endif()
|
|
||||||
|
|
||||||
get_property (TARGET_PROPERTY_IMP_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
|
|
||||||
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
|
|
||||||
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
|
|
||||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_property (TARGET_PROPERTY_LOCATION_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
|
|
||||||
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
|
|
||||||
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
|
||||||
else()
|
|
||||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endforeach()
|
|
||||||
else()
|
|
||||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
|
|
||||||
endif()
|
endif()
|
||||||
|
if (NOT 3RDPARTY_VTK_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
||||||
if (ALL_REQUIRED_VTK_LIBRARIES_FOUND)
|
if(EXISTS "${3RDPARTY_VTK_DIR}/lib")
|
||||||
|
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
|
||||||
if (3RDPARTY_VTK_INCLUDE_DIRS)
|
elseif (EXISTS "${3RDPARTY_VTK_DIR}/lib")
|
||||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_INCLUDE_DIRS)
|
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
list (GET 3RDPARTY_VTK_INCLUDE_DIRS 0 3RDPARTY_VTK_INCLUDE_DIR)
|
|
||||||
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_INCLUDE_DIR}" CACHE PATH "The directory containing headers of VTK" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (3RDPARTY_VTK_LIBRARY_DIRS)
|
|
||||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_LIBRARY_DIRS)
|
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
list (GET 3RDPARTY_VTK_LIBRARY_DIRS 0 3RDPARTY_VTK_LIBRARY_DIR)
|
|
||||||
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_LIBRARY_DIR}" CACHE PATH "The directory containing VTK libraries" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
if (3RDPARTY_VTK_DLL_DIRS)
|
|
||||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_DLL_DIRS)
|
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIRS})
|
|
||||||
|
|
||||||
list (GET 3RDPARTY_VTK_DLL_DIRS 0 3RDPARTY_VTK_DLL_DIR)
|
|
||||||
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DLL_DIR}" CACHE PATH "The directory containing VTK shared libraries" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(3RDPARTY_VTK_LIBRARY_DIR)
|
||||||
|
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# vtk libraries
|
||||||
|
# lib
|
||||||
|
set (VTK_LIBRARY_NAMES vtkCommonCore-${VTK_VERSION}.lib vtkCommonDataModel-${VTK_VERSION}.lib vtkCommonExecutionModel-${VTK_VERSION}.lib
|
||||||
|
vtkCommonMath-${VTK_VERSION}.lib vtkCommonTransforms-${VTK_VERSION}.lib vtkRenderingCore-${VTK_VERSION}.lib
|
||||||
|
vtkRenderingOpenGL-${VTK_VERSION}.lib vtkFiltersGeneral-${VTK_VERSION}.lib vtkIOCore-${VTK_VERSION}.lib
|
||||||
|
vtkIOImage-${VTK_VERSION}.lib vtkImagingCore-${VTK_VERSION}.lib vtkInteractionStyle-${VTK_VERSION}.lib )
|
||||||
|
|
||||||
|
#dll
|
||||||
|
set (VTK_DLL_NAMES vtkCommonComputationalGeometry-${VTK_VERSION}.dll
|
||||||
|
vtkCommonCore-${VTK_VERSION}.dll
|
||||||
|
vtkCommonDataModel-${VTK_VERSION}.dll
|
||||||
|
vtkCommonExecutionModel-${VTK_VERSION}.dll
|
||||||
|
vtkCommonMath-${VTK_VERSION}.dll
|
||||||
|
vtkCommonMisc-${VTK_VERSION}.dll
|
||||||
|
vtkCommonSystem-${VTK_VERSION}.dll
|
||||||
|
vtkCommonTransforms-${VTK_VERSION}.dll
|
||||||
|
vtkDICOMParser-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersCore-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersExtraction-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersGeneral-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersGeometry-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersSources-${VTK_VERSION}.dll
|
||||||
|
vtkFiltersStatistics-${VTK_VERSION}.dll
|
||||||
|
vtkIOCore-${VTK_VERSION}.dll
|
||||||
|
vtkIOImage-${VTK_VERSION}.dll
|
||||||
|
vtkImagingCore-${VTK_VERSION}.dll
|
||||||
|
vtkImagingFourier-${VTK_VERSION}.dll
|
||||||
|
vtkImagingHybrid-${VTK_VERSION}.dll
|
||||||
|
vtkInteractionStyle-${VTK_VERSION}.dll
|
||||||
|
vtkRenderingCore-${VTK_VERSION}.dll
|
||||||
|
vtkRenderingOpenGL-${VTK_VERSION}.dll
|
||||||
|
vtkalglib-${VTK_VERSION}.dll
|
||||||
|
vtkjpeg-${VTK_VERSION}.dll
|
||||||
|
vtkmetaio-${VTK_VERSION}.dll
|
||||||
|
vtkpng-${VTK_VERSION}.dll
|
||||||
|
vtksys-${VTK_VERSION}.dll
|
||||||
|
vtktiff-${VTK_VERSION}.dll
|
||||||
|
vtkzlib-${VTK_VERSION}.dll )
|
||||||
|
|
||||||
|
# search for dll directory
|
||||||
|
if (WIN32)
|
||||||
|
if (NOT 3RDPARTY_VTK_DLL_DIR OR NOT EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
||||||
|
if(EXISTS "${3RDPARTY_VTK_DIR}/bin")
|
||||||
|
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bin" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
|
||||||
|
elseif (EXISTS "${3RDPARTY_VTK_DIR}/bind")
|
||||||
|
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bind" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (3RDPARTY_VTK_DLL_DIR OR EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
||||||
|
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_VTK_DLL_DIR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
OCCT_CHECK_AND_UNSET(VTK_DIR)
|
||||||
|
|
||||||
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||||
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
|
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
|
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (3RDPARTY_VTK_LIBRARY_DIR AND EXISTS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
if (INSTALL_VTK)
|
||||||
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIR})
|
OCCT_MAKE_OS_WITH_BITNESS()
|
||||||
else()
|
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_LIBRARY_DIR)
|
if (WIN32)
|
||||||
endif()
|
if(3RDPARTY_VTK_DLL_DIR AND EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||||
|
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
|
||||||
|
set (3RDPARTY_VTK_DLL "3RDPARTY_VTK_DLL-NOTFOUND" CACHE FILEPATH "VTK shared library" FORCE)
|
||||||
|
find_library(3RDPARTY_VTK_DLL "${VTK_DLL_NAME}" PATHS "${3RDPARTY_VTK_DLL_DIR}" NO_DEFAULT_PATH)
|
||||||
|
if (NOT 3RDPARTY_VTK_DLL OR NOT EXISTS "${3RDPARTY_VTK_DLL}")
|
||||||
|
list (APPEND 3RDPARTY_NOT_INCLUDED "${3RDPARTY_VTK_DLL}")
|
||||||
|
else()
|
||||||
|
install (FILES ${3RDPARTY_VTK_DLL}
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||||
|
install (FILES ${3RDPARTY_VTK_DLL}
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||||
|
install (FILES ${3RDPARTY_VTK_DLL}
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
OCCT_CHECK_AND_UNSET(3RDPARTY_VTK_DLL)
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
|
||||||
|
string(REPLACE ".dll" ".so.1" VTK_DLL_NAME "${VTK_DLL_NAME}")
|
||||||
|
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||||
|
RENAME "lib${VTK_DLL_NAME}")
|
||||||
|
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||||
|
RENAME "lib${VTK_DLL_NAME}")
|
||||||
|
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}"
|
||||||
|
CONFIGURATIONS Debug
|
||||||
|
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||||
|
RENAME "lib${VTK_DLL_NAME}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
set (USED_3RDPARTY_VTK_DIR "")
|
||||||
if (3RDPARTY_VTK_DLL_DIR OR EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
else()
|
||||||
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIR})
|
# the library directory for using by the executable
|
||||||
|
if (WIN32)
|
||||||
|
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_DLL_DIR})
|
||||||
else()
|
else()
|
||||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_DLL_DIR)
|
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_LIBRARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# the library directory for using by the executable
|
|
||||||
if (WIN32)
|
|
||||||
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_DLL_DIR})
|
|
||||||
else()
|
|
||||||
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_LIBRARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced (VTK_INCLUDE_DIRS VTK_LIBRARY_DIRS VTK_DIR)
|
mark_as_advanced (VTK_INCLUDE_DIRS VTK_LIBRARY_DIRS VTK_DIR)
|
||||||
|
@@ -731,7 +731,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
|||||||
|
|
||||||
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
|
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
|
||||||
puts $doxyFile "DOT_PATH = $graphvizPath"
|
puts $doxyFile "DOT_PATH = $graphvizPath"
|
||||||
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetIncDir $productsPath]"
|
||||||
|
|
||||||
# list of files to generate
|
# list of files to generate
|
||||||
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
|
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
|
||||||
|
@@ -1109,19 +1109,12 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
|||||||
set aFrmsMap(CSF_TclLibs) "Tcl"
|
set aFrmsMap(CSF_TclLibs) "Tcl"
|
||||||
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
||||||
} else {
|
} else {
|
||||||
if { "$theOS" == "qnx" } {
|
set aLibsMap(CSF_ThreadLibs) "pthread rt"
|
||||||
# CSF_ThreadLibs - pthread API is part og libc on QNX
|
set aLibsMap(CSF_OpenGlLibs) "GL"
|
||||||
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
|
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
||||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
|
||||||
set aLibsMap(CSF_TclTkLibs) "tk8.6"
|
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||||
} else {
|
set aLibsMap(CSF_MotifLibs) "X11"
|
||||||
set aLibsMap(CSF_ThreadLibs) "pthread rt"
|
|
||||||
set aLibsMap(CSF_OpenGlLibs) "GL"
|
|
||||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
|
||||||
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
|
|
||||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
|
||||||
set aLibsMap(CSF_MotifLibs) "X11"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# optional 3rd-parties
|
# optional 3rd-parties
|
||||||
@@ -2061,13 +2054,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
# Release target configuration
|
# Release target configuration
|
||||||
puts $aFile "\t\t\t<Target title=\"Release\">"
|
puts $aFile "\t\t\t<Target title=\"Release\">"
|
||||||
if { "$theIsExe" == "true" } {
|
if { "$theIsExe" == "true" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
if { "$aWokStation" == "wnt" } {
|
if { "$aWokStation" == "wnt" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||||
}
|
}
|
||||||
@@ -2077,8 +2070,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
|
||||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
|
||||||
|
|
||||||
# compiler options per TARGET (including defines)
|
# compiler options per TARGET (including defines)
|
||||||
puts $aFile "\t\t\t\t<Compiler>"
|
puts $aFile "\t\t\t\t<Compiler>"
|
||||||
@@ -2092,20 +2085,15 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
||||||
if { "$aWokStation" != "qnx" } {
|
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
foreach aMacro $theDefines {
|
foreach aMacro $theDefines {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />"
|
||||||
if { "$aWokStation" == "qnx" } {
|
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
|
|
||||||
}
|
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />"
|
||||||
|
|
||||||
puts $aFile "\t\t\t\t</Compiler>"
|
puts $aFile "\t\t\t\t</Compiler>"
|
||||||
@@ -2123,13 +2111,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
# Debug target configuration
|
# Debug target configuration
|
||||||
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
||||||
if { "$theIsExe" == "true" } {
|
if { "$theIsExe" == "true" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
if { "$aWokStation" == "wnt" } {
|
if { "$aWokStation" == "wnt" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||||
}
|
}
|
||||||
@@ -2139,8 +2127,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
|
||||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
|
||||||
|
|
||||||
# compiler options per TARGET (including defines)
|
# compiler options per TARGET (including defines)
|
||||||
puts $aFile "\t\t\t\t<Compiler>"
|
puts $aFile "\t\t\t\t<Compiler>"
|
||||||
@@ -2156,20 +2144,15 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
|||||||
puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-g\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-g\" />"
|
||||||
if { "$aWokStation" != "qnx" } {
|
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
foreach aMacro $theDefines {
|
foreach aMacro $theDefines {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />"
|
||||||
if { "$aWokStation" == "qnx" } {
|
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
|
|
||||||
}
|
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />"
|
||||||
puts $aFile "\t\t\t\t</Compiler>"
|
puts $aFile "\t\t\t\t</Compiler>"
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@ echo off
|
|||||||
if "%VCVER%" == "@COMPILER@" (
|
if "%VCVER%" == "@COMPILER@" (
|
||||||
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
||||||
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
||||||
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
|
|
||||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||||
set "FREEIMAGEPLUS_DIR=@3RDPARTY_FREEIMAGEPLUS_DLL_DIR@"
|
set "FREEIMAGEPLUS_DIR=@3RDPARTY_FREEIMAGEPLUS_DLL_DIR@"
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
if [ "$COMPILER" == "@COMPILER@" ]; then
|
if [ "$COMPILER" == "@COMPILER@" ]; then
|
||||||
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
||||||
export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
|
export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
|
||||||
export TK_DIR="@3RDPARTY_TK_LIBRARY_DIR@"
|
|
||||||
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
|
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
|
||||||
export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIR@"
|
export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIR@"
|
||||||
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIR@"
|
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIR@"
|
||||||
|
@@ -3,7 +3,6 @@ echo off
|
|||||||
if "%VCVER%" == "@COMPILER@" (
|
if "%VCVER%" == "@COMPILER@" (
|
||||||
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
||||||
set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
|
set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
|
||||||
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
|
|
||||||
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
|
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
|
||||||
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
|
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
|
||||||
set "FREEIMAGEPLUS_DIR=@USED_3RDPARTY_FREEIMAGEPLUS_DIR@"
|
set "FREEIMAGEPLUS_DIR=@USED_3RDPARTY_FREEIMAGEPLUS_DIR@"
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
if [ "$COMPILER" == "@COMPILER@" ]; then
|
if [ "$COMPILER" == "@COMPILER@" ]; then
|
||||||
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
||||||
export TCL_DIR="@USED_3RDPARTY_TCL_DIR@"
|
export TCL_DIR="@USED_3RDPARTY_TCL_DIR@"
|
||||||
export TK_DIR="@USED_3RDPARTY_TK_DIR@"
|
|
||||||
export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@"
|
export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@"
|
||||||
export FREEIMAGE_DIR="@USED_3RDPARTY_FREEIMAGE_DIR@"
|
export FREEIMAGE_DIR="@USED_3RDPARTY_FREEIMAGE_DIR@"
|
||||||
export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIR@"
|
export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIR@"
|
||||||
|
@@ -22,6 +22,7 @@ set "HAVE_TBB=false"
|
|||||||
set "HAVE_OPENCL=false"
|
set "HAVE_OPENCL=false"
|
||||||
set "HAVE_FREEIMAGE=false"
|
set "HAVE_FREEIMAGE=false"
|
||||||
set "HAVE_GL2PS=false"
|
set "HAVE_GL2PS=false"
|
||||||
|
set "HAVE_OPENCL=false"
|
||||||
set "HAVE_VTK=false"
|
set "HAVE_VTK=false"
|
||||||
set "HAVE_D3D=false"
|
set "HAVE_D3D=false"
|
||||||
set "CSF_OPT_INC="
|
set "CSF_OPT_INC="
|
||||||
|
@@ -28,7 +28,6 @@ set "PRODROOT="
|
|||||||
set "ORIGIN_PATH=%PATH%"
|
set "ORIGIN_PATH=%PATH%"
|
||||||
|
|
||||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
|
||||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
||||||
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
||||||
@@ -39,10 +38,6 @@ if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
|||||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||||
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
||||||
set "PATH=@CMAKE_BINARY_DIR@/%BIN_TAIL%;%PATH%"
|
set "PATH=@CMAKE_BINARY_DIR@/%BIN_TAIL%;%PATH%"
|
||||||
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
|
|
||||||
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
)
|
|
||||||
|
|
||||||
rem ----- Set envoronment variables used by OCCT -----
|
rem ----- Set envoronment variables used by OCCT -----
|
||||||
set CSF_LANGUAGE=us
|
set CSF_LANGUAGE=us
|
||||||
|
@@ -45,10 +45,6 @@ if [ "$TCL_DIR" != "" ]; then
|
|||||||
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TK_DIR" != "" ]; then
|
|
||||||
THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FREETYPE_DIR" != "" ]; then
|
if [ "$FREETYPE_DIR" != "" ]; then
|
||||||
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
@@ -69,15 +65,6 @@ if [ "$VTK_DIR" != "" ]; then
|
|||||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TK_DIR" != "$TCL_DIR" ]; then
|
|
||||||
if [ "$TK_DIR" != "" ]; then
|
|
||||||
export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
fi
|
|
||||||
if [ "$TCL_DIR" != "" ]; then
|
|
||||||
export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
||||||
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
||||||
|
|
||||||
|
@@ -26,7 +26,6 @@ set "PRODROOT="
|
|||||||
set "ORIGIN_PATH=%PATH%"
|
set "ORIGIN_PATH=%PATH%"
|
||||||
|
|
||||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
|
||||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
||||||
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
||||||
@@ -37,10 +36,6 @@ if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
|||||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||||
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
||||||
set "PATH=%CASROOT%/%BIN_TAIL%;%PATH%"
|
set "PATH=%CASROOT%/%BIN_TAIL%;%PATH%"
|
||||||
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
|
|
||||||
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
)
|
|
||||||
|
|
||||||
rem ----- Set envoronment variables used by OCCT -----
|
rem ----- Set envoronment variables used by OCCT -----
|
||||||
set CSF_LANGUAGE=us
|
set CSF_LANGUAGE=us
|
||||||
|
@@ -43,10 +43,6 @@ if [ "$TCL_DIR" != "" ]; then
|
|||||||
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TK_DIR" != "" ]; then
|
|
||||||
THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FREETYPE_DIR" != "" ]; then
|
if [ "$FREETYPE_DIR" != "" ]; then
|
||||||
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
@@ -67,15 +63,6 @@ if [ "$VTK_DIR" != "" ]; then
|
|||||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TK_DIR" != "$TCL_DIR" ]; then
|
|
||||||
if [ "$TK_DIR" != "" ]; then
|
|
||||||
export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
fi
|
|
||||||
if [ "$TCL_DIR" != "" ]; then
|
|
||||||
export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
||||||
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
||||||
|
|
||||||
|
138
adm/upgrade.tcl
@@ -477,77 +477,6 @@ proc ConvertTColFwd {thePackagePath theHeaderExtensions} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# try to find source file corresponding to the specified header and either
|
|
||||||
# inject macro IMPLEMENT_STANDARD_RTTIEXT in it, or check it already present,
|
|
||||||
# and depending on this, return suffix to be used for corresponding macro
|
|
||||||
# DEFINE_STANDARD_RTTI... (either inline or out-of-line variant)
|
|
||||||
proc DefineExplicitRtti {hxxfile class base theSourceExtensions} {
|
|
||||||
# if current file is not a header (by extension), exit with "inline" variant
|
|
||||||
# (there is no need to bother with out-of-line instantiations for local class)
|
|
||||||
set ext [string range [file extension $hxxfile] 1 end]
|
|
||||||
if { [lsearch -exact [split $theSourceExtensions ,] $ext] >=0 } {
|
|
||||||
return "_INLINE"
|
|
||||||
}
|
|
||||||
|
|
||||||
# try to find source file with the same name but source-type extension
|
|
||||||
# in the same folder
|
|
||||||
set filename [file rootname $hxxfile]
|
|
||||||
foreach ext [split $theSourceExtensions ,] {
|
|
||||||
# puts "Checking ${filename}.$ext"
|
|
||||||
if { ! [file readable ${filename}.$ext] } { continue }
|
|
||||||
|
|
||||||
# check the file content
|
|
||||||
set aFileContent [ReadFileToList ${filename}.$ext aFileRawContent aEOL]
|
|
||||||
|
|
||||||
# try to find existing macro IMPLEMENT_STANDARD_RTTIEXT and check that
|
|
||||||
# it is consistent
|
|
||||||
foreach line $aFileContent {
|
|
||||||
if { [regexp "^\\s*IMPLEMENT_STANDARD_RTTIEXT\\s*\\(\\s*$class\\s*,\\s*(\[A-Za-z0-9_\]+)\\s*\\)" $line res impl_base] } {
|
|
||||||
# implementation is in place, just report warning if second argument
|
|
||||||
# is different
|
|
||||||
if { $base != $impl_base } {
|
|
||||||
logwarn "Warning in ${filename}.$ext: second argument of macro"
|
|
||||||
logwarn " IMPLEMENT_STANDARD_RTTIEXT($class,$impl_base)"
|
|
||||||
logwarn " is not the same as detected base class, $base"
|
|
||||||
}
|
|
||||||
return "EXT"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# inject a new macro before the first non-empty, non-comment, and
|
|
||||||
# non-preprocessor line
|
|
||||||
set aNewFileContent {}
|
|
||||||
set injected 0
|
|
||||||
set inc_found 0
|
|
||||||
foreach line $aFileContent {
|
|
||||||
if { ! $injected } {
|
|
||||||
# add macro before first non-empty line after #includes
|
|
||||||
if { [regexp {^\s*$} $line] } {
|
|
||||||
} elseif { [regexp {^\s*\#\s*include} $line] } {
|
|
||||||
set inc_found 1
|
|
||||||
} elseif { $inc_found } {
|
|
||||||
set injected 1
|
|
||||||
lappend aNewFileContent "IMPLEMENT_STANDARD_RTTIEXT($class,$base)"
|
|
||||||
if { ! [regexp "^IMPLEMENT_" $line] } {
|
|
||||||
lappend aNewFileContent ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lappend aNewFileContent $line
|
|
||||||
}
|
|
||||||
if { ! $injected } {
|
|
||||||
lappend aNewFileContent "IMPLEMENT_STANDARD_RTTIEXT($class,$base)"
|
|
||||||
}
|
|
||||||
SaveListToFile ${filename}.$ext $aNewFileContent $aEOL
|
|
||||||
|
|
||||||
return "EXT"
|
|
||||||
}
|
|
||||||
|
|
||||||
logwarn "Warning in ${hxxfile}: cannot find corresponding source file,"
|
|
||||||
logwarn " will use inline version of DEFINE_STANDARD_RTTI"
|
|
||||||
return "_INLINE"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse source files and:
|
# Parse source files and:
|
||||||
#
|
#
|
||||||
# - add second argument to macro DEFINE_STANDARD_RTTI specifying first base
|
# - add second argument to macro DEFINE_STANDARD_RTTI specifying first base
|
||||||
@@ -592,14 +521,13 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
|
|
||||||
# find all instances of DEFINE_STANDARD_RTTI with single or two arguments
|
# find all instances of DEFINE_STANDARD_RTTI with single or two arguments
|
||||||
set index 0
|
set index 0
|
||||||
set pattern_rtti {^(\s*DEFINE_STANDARD_RTTI)([_A-Z]+)?\s*\(\s*([A-Za-z_0-9,\s]+)\s*\)}
|
set pattern_rtti {^(\s*DEFINE_STANDARD_RTTI\s*)\(\s*([A-Za-z_0-9,\s]+)\s*\)}
|
||||||
while { [regexp -start $index -indices -lineanchor $pattern_rtti \
|
while { [regexp -start $index -indices -lineanchor $pattern_rtti \
|
||||||
$aProcessedFileContent location start suffix clist] } {
|
$aProcessedFileContent location start clist] } {
|
||||||
set index [lindex $location 1]
|
set index [lindex $location 1]
|
||||||
|
|
||||||
set start [eval string range \$aProcessedFileContent $start]
|
set start [eval string range \$aProcessedFileContent $start]
|
||||||
set suffix [eval string range \$aProcessedFileContent $suffix]
|
set clist [split [eval string range \$aProcessedFileContent $clist] ,]
|
||||||
set clist [split [eval string range \$aProcessedFileContent $clist] ,]
|
|
||||||
|
|
||||||
if { [llength $clist] == 1 } {
|
if { [llength $clist] == 1 } {
|
||||||
set class [string trim [lindex $clist 0]]
|
set class [string trim [lindex $clist 0]]
|
||||||
@@ -610,8 +538,7 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
logwarn "macro DEFINE_STANDARD_RTTI is changed assuming it inherits $inherits($class), please check!"
|
logwarn "macro DEFINE_STANDARD_RTTI is changed assuming it inherits $inherits($class), please check!"
|
||||||
}
|
}
|
||||||
set change_flag 1
|
set change_flag 1
|
||||||
ReplaceSubString aProcessedFileContent $location \
|
ReplaceSubString aProcessedFileContent $location "${start}($class, $inherits($class))" index
|
||||||
"${start}EXT($class,$inherits($class))" index
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logwarn "Error in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file, cannot fix"
|
logwarn "Error in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file, cannot fix"
|
||||||
@@ -621,19 +548,12 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
set base [string trim [lindex $clist 1]]
|
set base [string trim [lindex $clist 1]]
|
||||||
if { ! [info exists inherits($class)] } {
|
if { ! [info exists inherits($class)] } {
|
||||||
logwarn "Warning in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file"
|
logwarn "Warning in $aProcessedFile: Macro DEFINE_STANDARD_RTTI used for class $class whose declaration is not found in this file"
|
||||||
} elseif { $base != $inherits($class) && ! [info exists inherits($class,multiple)] } {
|
} elseif { $base != $inherits($class) } {
|
||||||
logwarn "Warning in $aProcessedFile: Second argument in macro DEFINE_STANDARD_RTTI for class $class is $base while $class seems to inherit from $inherits($class)"
|
logwarn "Warning in $aProcessedFile: Second argument in macro DEFINE_STANDARD_RTTI for class $class is $base while $class seems to inherit from $inherits($class)"
|
||||||
}
|
if { ! $theCheckMode && ! [info exists inherits($class,multiple)] } {
|
||||||
# convert intermediate version of macro DEFINE_STANDARD_RTTI
|
set change_flag 1
|
||||||
# with two arguments to either _INLINE or EXT variant
|
ReplaceSubString aProcessedFileContent $location "${start}($class, $inherits($class))" index
|
||||||
if { ! $theCheckMode && "$suffix" == "" } {
|
}
|
||||||
set change_flag 1
|
|
||||||
# try to inject macro IMPLEMENT_STANDARD_RTTIEXT in the
|
|
||||||
# corresponding source file (or check it already present),
|
|
||||||
# and depending on this, use either inline or out-of-line variant
|
|
||||||
set rtti_suffix [DefineExplicitRtti $aProcessedFile $class $base $theSourceExtensions]
|
|
||||||
ReplaceSubString aProcessedFileContent $location \
|
|
||||||
"${start}${rtti_suffix}($class,$base)" index
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -658,12 +578,8 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
set index 0
|
set index 0
|
||||||
set first_newline \n\n
|
set first_newline \n\n
|
||||||
set pattern_implement {\\?\n\s*IMPLEMENT_(DOWNCAST|STANDARD_[A-Z_]+|HARRAY1|HARRAY2|HUBTREE|HEBTREE|HSEQUENCE)\s*\([A-Za-z0-9_ ,]*\)\s*;?}
|
set pattern_implement {\\?\n\s*IMPLEMENT_(DOWNCAST|STANDARD_[A-Z_]+|HARRAY1|HARRAY2|HUBTREE|HEBTREE|HSEQUENCE)\s*\([A-Za-z0-9_ ,]*\)\s*;?}
|
||||||
while { [regexp -start $index -indices -lineanchor $pattern_implement $aProcessedFileContent location macro] } {
|
while { [regexp -start $index -indices -lineanchor $pattern_implement $aProcessedFileContent location] } {
|
||||||
set index [lindex $location 1]
|
set index [lindex $location 1]
|
||||||
# macro IMPLEMENT_STANDARD_RTTIEXT is retained
|
|
||||||
if { [eval string range \$aProcessedFileContent $macro] == "STANDARD_RTTIEXT" } {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if { ! $theCheckMode } {
|
if { ! $theCheckMode } {
|
||||||
set change_flag 1
|
set change_flag 1
|
||||||
ReplaceSubString aProcessedFileContent $location $first_newline index
|
ReplaceSubString aProcessedFileContent $location $first_newline index
|
||||||
@@ -678,7 +594,7 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
|
|
||||||
# find all uses of macro STANDARD_TYPE and method DownCast and ensure that
|
# find all uses of macro STANDARD_TYPE and method DownCast and ensure that
|
||||||
# argument class is explicitly included
|
# argument class is explicitly included
|
||||||
set pattern_incbeg {\s*#\s*include\s*[\"<]\s*([A-Za-z0-9_/]*/)?}
|
set pattern_incbeg {\s*#\s*include\s*[\"<]\s*}
|
||||||
set pattern_incend {[.][a-zA-Z]+\s*[\">]}
|
set pattern_incend {[.][a-zA-Z]+\s*[\">]}
|
||||||
set index 0
|
set index 0
|
||||||
set addtype {}
|
set addtype {}
|
||||||
@@ -706,9 +622,7 @@ proc ConvertRtti {theProcessedPath theIncPaths theCheckMode theCompatibleMode \
|
|||||||
if { ! $theCheckMode } {
|
if { ! $theCheckMode } {
|
||||||
set addinc ""
|
set addinc ""
|
||||||
foreach type $addtype {
|
foreach type $addtype {
|
||||||
if { "$aProcessedFileName" != "$type.hxx" } {
|
append addinc "\n#include <$type.hxx>"
|
||||||
append addinc "\n#include <$type.hxx>"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if { [regexp -indices ".*\n${pattern_incbeg}\[A-Za-z0-9_/\]+${pattern_incend}" $aProcessedFileContent location] } {
|
if { [regexp -indices ".*\n${pattern_incbeg}\[A-Za-z0-9_/\]+${pattern_incend}" $aProcessedFileContent location] } {
|
||||||
set change_flag 1
|
set change_flag 1
|
||||||
@@ -735,7 +649,6 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
|
|||||||
|
|
||||||
# iterate by header files
|
# iterate by header files
|
||||||
foreach aHeader [glob -nocomplain -type f -directory $theTargetPath *.{$theExtensions}] {
|
foreach aHeader [glob -nocomplain -type f -directory $theTargetPath *.{$theExtensions}] {
|
||||||
set aCurrentHeaderName [file tail $aHeader]
|
|
||||||
|
|
||||||
# skip gxx files, as names Handle_xxx used there are in most cases
|
# skip gxx files, as names Handle_xxx used there are in most cases
|
||||||
# placeholders of the argument types substituted by #define
|
# placeholders of the argument types substituted by #define
|
||||||
@@ -769,9 +682,8 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
|
|||||||
set anUpdatedHeaderContent {}
|
set anUpdatedHeaderContent {}
|
||||||
set pattern_handle {\mHandle_([A-Za-z0-9_]+)}
|
set pattern_handle {\mHandle_([A-Za-z0-9_]+)}
|
||||||
foreach line $aHeaderContent {
|
foreach line $aHeaderContent {
|
||||||
# do not touch typedefs, #include, and #if... statements
|
# do not touch #include and #if... statements
|
||||||
if { [regexp {^\s*typedef} $line] ||
|
if { [regexp {\s*\#\s*include} $line] || [regexp {\s*\#\s*if} $line] } {
|
||||||
[regexp {^\s*\#\s*include} $line] || [regexp {^\s*\#\s*if} $line] } {
|
|
||||||
lappend anUpdatedHeaderContent $line
|
lappend anUpdatedHeaderContent $line
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -851,8 +763,8 @@ proc ConvertHandle {theTargetPath theIncPaths theCheckMode theExtensions} {
|
|||||||
} else {
|
} else {
|
||||||
# replace by forward declaration of a class or its include unless
|
# replace by forward declaration of a class or its include unless
|
||||||
# it is already declared or included
|
# it is already declared or included
|
||||||
if { ! [regexp "\#\\s*include\\s*\[\<\"\]\\s*(\[A-Za-z0-9_/\]*/)?$aForwardDeclHandledClass\[.\]hxx\\s*\[\>\"\]" $aHeaderContent] } {
|
if { ! [regexp "^\s*\#\s*include\s*\[\<\"\]\s*$aForwardDeclHandledClass\s*\[\>\"\]" $aHeaderContent] } {
|
||||||
if { $isQObject && "$aCurrentHeaderName" != "${aForwardDeclHandledClass}.hxx" } {
|
if { $isQObject } {
|
||||||
lappend anUpdatedHeaderContent "#include <${aForwardDeclHandledClass}.hxx>"
|
lappend anUpdatedHeaderContent "#include <${aForwardDeclHandledClass}.hxx>"
|
||||||
if { ! [SearchForFile $theIncPaths ${aForwardDeclHandledClass}.hxx] } {
|
if { ! [SearchForFile $theIncPaths ${aForwardDeclHandledClass}.hxx] } {
|
||||||
loginfo "Warning: include ${aForwardDeclHandledClass}.hxx added in $aHeader, assuming it exists and defines Handle_$aForwardDeclHandledClass"
|
loginfo "Warning: include ${aForwardDeclHandledClass}.hxx added in $aHeader, assuming it exists and defines Handle_$aForwardDeclHandledClass"
|
||||||
@@ -1034,10 +946,7 @@ proc ConvertCStyleHandleCast {pkpath theExtensions theCheckMode} {
|
|||||||
while { [regexp -start $index -indices -lineanchor $pattern_refcast0 $hxx location class var] } {
|
while { [regexp -start $index -indices -lineanchor $pattern_refcast0 $hxx location class var] } {
|
||||||
set index [lindex $location 1]
|
set index [lindex $location 1]
|
||||||
|
|
||||||
set var [eval string range \$hxx $var]
|
logwarn "Warning in $afile: C-style cast: [eval string range \$hxx $location]"
|
||||||
if { "$var" != "const" && "$var" != "Standard_OVERRIDE" } {
|
|
||||||
logwarn "Warning in $afile: C-style cast: [eval string range \$hxx $location]"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# replace const Handle(A)& a = Handle(B)::DownCast (b); by
|
# replace const Handle(A)& a = Handle(B)::DownCast (b); by
|
||||||
@@ -1172,11 +1081,10 @@ proc ReadFileToList {theFilePath theFileContent theFileEOL} {
|
|||||||
regsub -all {$aFileEOL} $aFileContent "\n" aFileContent
|
regsub -all {$aFileEOL} $aFileContent "\n" aFileContent
|
||||||
}
|
}
|
||||||
|
|
||||||
set aList [split $aFileContent "\n"]
|
set aList {}
|
||||||
# set aList {}
|
foreach aLine [split $aFileContent "\n"] {
|
||||||
# foreach aLine [split $aFileContent "\n"] {
|
lappend aList [string trimright $aLine]
|
||||||
# lappend aList [string trimright $aLine]
|
}
|
||||||
# }
|
|
||||||
|
|
||||||
return $aList
|
return $aList
|
||||||
}
|
}
|
||||||
@@ -1246,8 +1154,6 @@ proc SaveListToFile {theFilePath theData {theEOL "auto"}} {
|
|||||||
fconfigure $aFile -translation binary
|
fconfigure $aFile -translation binary
|
||||||
puts -nonewline $aFile [join $theData $anUsedEol]
|
puts -nonewline $aFile [join $theData $anUsedEol]
|
||||||
close $aFile
|
close $aFile
|
||||||
|
|
||||||
loginfo "File $theFilePath modified"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# collect all subdirs of theBaseDir
|
# collect all subdirs of theBaseDir
|
||||||
|
@@ -1,67 +0,0 @@
|
|||||||
// This is sample C++ file intended for testing and verifyig automatic upgrade
|
|
||||||
// script. Copy it with extension .cxx and apply upgrade procedure to see
|
|
||||||
// the result, as follows:
|
|
||||||
// > upgrade.bat -src=./adm -inc=./src -recurse -all
|
|
||||||
|
|
||||||
// Include of Geom_Line.hxx and Geom_Plane.hxx should be added below
|
|
||||||
#include <gp.hxx>
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// OCCT 7.0
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
// Option -rtti
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Should be replaced by <Standard_Type.hxx>
|
|
||||||
#include <Standard_DefineHandle.hxx>
|
|
||||||
|
|
||||||
class A_0
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
class B_1 :
|
|
||||||
public A_0
|
|
||||||
{
|
|
||||||
// second argument "A_0" should be added
|
|
||||||
DEFINE_STANDARD_RTTI(B_1)
|
|
||||||
};
|
|
||||||
|
|
||||||
class C_2 : public Standard_Transient, B_1
|
|
||||||
{
|
|
||||||
// second argument "Standard_Transient" should be added
|
|
||||||
DEFINE_STANDARD_RTTI(C_2)
|
|
||||||
};
|
|
||||||
|
|
||||||
void for_rtti ()
|
|
||||||
{
|
|
||||||
Handle(Geom_Curve) aCurve = new Geom_Line (gp::Origin(), gp::DZ());
|
|
||||||
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (aCurve);
|
|
||||||
}
|
|
||||||
|
|
||||||
// should be removed
|
|
||||||
IMPLEMENT_DOWNCAST(A)
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(A, B)
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
// Option -fwd
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// force safe mode used for Qt objects
|
|
||||||
Q_OBJECT
|
|
||||||
slots:
|
|
||||||
|
|
||||||
// these includes should be recognized as corresponding to forward declarations
|
|
||||||
#include <occt/TColStd_HArray1OfReal.hxx>
|
|
||||||
|
|
||||||
// these declarations should be just removed
|
|
||||||
class Handle(TColStd_HArray1OfReal);
|
|
||||||
|
|
||||||
// should be replaced by include of corresponding header
|
|
||||||
class TColStd_Array1OfReal;
|
|
||||||
class Handle(Geom_Curve);
|
|
||||||
|
|
||||||
// check that trailing spaces at the following line are preserved
|
|
||||||
void ff();
|
|
||||||
|
|
@@ -1,21 +1,19 @@
|
|||||||
Building with CMake for Android {#occt_dev_guides__building_android}
|
Building with CMake and ADT for Android {#occt_dev_guides__building_android}
|
||||||
===================
|
===================
|
||||||
|
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
This article describes the steps to build OCCT libraries for Android from a complete source package
|
This file describes the steps to build OCCT libraries from a complete source package
|
||||||
with GNU make (makefiles) on Windows 7 and Ubuntu 15.10.
|
with following tools:
|
||||||
|
- Generation of eclipse project files
|
||||||
|
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
|
||||||
|
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
|
||||||
|
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
|
||||||
|
- Make: MinGW v4.82+ for Windows, GNU Make vXX for Linux. http://sourceforge.net/projects/mingw/files/
|
||||||
|
- Building eclipse project files of OCCT
|
||||||
|
- Android Developer Tools (ADT) v22+ https://developer.android.com/sdk/index.html
|
||||||
|
|
||||||
The steps on Windows and Ubuntu are similar. There is the only one difference: makefiles are built with mingw32-make
|
## Generation of eclipse project files
|
||||||
on Windows and native GNU make on Ubuntu.
|
|
||||||
|
|
||||||
Required tools (download and install if it is required):
|
|
||||||
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
|
|
||||||
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
|
|
||||||
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
|
|
||||||
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
|
|
||||||
|
|
||||||
## Generation of makefiles
|
|
||||||
Run GUI tool provided by CMake: cmake-gui
|
Run GUI tool provided by CMake: cmake-gui
|
||||||
|
|
||||||
### Tools configuration
|
### Tools configuration
|
||||||
@@ -24,23 +22,21 @@ Run GUI tool provided by CMake: cmake-gui
|
|||||||
|
|
||||||
@figure{/dev_guides/building/android/images/android_image001.png}
|
@figure{/dev_guides/building/android/images/android_image001.png}
|
||||||
|
|
||||||
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
|
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project. -
|
||||||
|
|
||||||
Select "MinGW MakeFiles" item from the list
|
Select "Eclipse CDT4 - MinGW MakeFiles" item from the list
|
||||||
- Choose "Specify toolchain file for cross-compiling"
|
- Choose "Specify toolchain file for cross-compiling"
|
||||||
- Click "Next"
|
- Click "Next"
|
||||||
@figure{/dev_guides/building/android/images/android_image002.png}
|
@figure{/dev_guides/building/android/images/android_image002.png}
|
||||||
|
- Specify the Toolchain file at next dialog by android.toolchain.cmake is contained by cross-compilation toolchain for CMake
|
||||||
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation toolchain for CMake
|
|
||||||
- Click "Finish"
|
- Click "Finish"
|
||||||
@figure{/dev_guides/building/android/images/android_image003.png}
|
@figure{/dev_guides/building/android/images/android_image003.png}
|
||||||
|
|
||||||
If ANDROID_NDK environment variable is not defined in current OS, add cache entry ANDROID_NDK (entry type is PATH) - path to the NDK folder ("Add Entry" button)
|
Add cache entry ANDROID_NDK - path (entry type is PATH) to the NDK folder ("Add Entry" button)
|
||||||
@figure{/dev_guides/building/android/images/android_image004.png}
|
@figure{/dev_guides/building/android/images/android_image004.png}
|
||||||
|
|
||||||
If on Windows the message is appeared: "CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles"
|
if there is message "CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool."
|
||||||
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
|
Define CMAKE_MAKE_PROGRAM variable with the file path to mingw32-make executable.
|
||||||
specify **CMAKE_MAKE_PROGRAM** to mingw32-make executable.
|
|
||||||
@figure{/dev_guides/building/android/images/android_image005.png}
|
@figure{/dev_guides/building/android/images/android_image005.png}
|
||||||
|
|
||||||
### OCCT Configuration
|
### OCCT Configuration
|
||||||
@@ -49,36 +45,27 @@ How to configure OCCT, see "OCCT Configuration" section of @ref occt_dev_guides_
|
|||||||
taking into account the specific configuration variables for android:
|
taking into account the specific configuration variables for android:
|
||||||
- ANDROID_ABI = armeabi-v7a
|
- ANDROID_ABI = armeabi-v7a
|
||||||
- ANDROID_NATIVE_API_LEVEL = 15
|
- ANDROID_NATIVE_API_LEVEL = 15
|
||||||
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
|
- ANDROID_NDK_LAYOUT is equal to BUILD_CONFIGURATION variable
|
||||||
- **BUILD_MODULE_Draw = OFF**
|
- CMAKE_ECLIPSE_VERSION is equal to installed eclipse version (e.g., 4.2)
|
||||||
|
|
||||||
|
Configure parallel building:
|
||||||
|
- CMAKE_ECLIPSE_MAKE_ARGUMENTS = -jN where N = your numbers of CPU cores (threads)
|
||||||
|
|
||||||
@figure{/dev_guides/building/android/images/android_image006.png}
|
@figure{/dev_guides/building/android/images/android_image006.png}
|
||||||
|
|
||||||
### Generation of makefiles
|
### Generation of eclipse projects files
|
||||||
|
|
||||||
Click **Generate** button and wait until the generation process is finished.
|
Click **Generate** button and wait until the generation process is finished.
|
||||||
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
|
Then the eclipse project files will appear in the build folder (e.g. <i> D:/android-build-eclipse-api-15 </i>).
|
||||||
|
|
||||||
## Building makefiles of OCCT
|
## Building eclipse project files of OCCT
|
||||||
|
|
||||||
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process.
|
- Open eclipse (downloaded ADT bundle contains it)
|
||||||
|
@figure{/dev_guides/building/android/images/android_image007.png}
|
||||||
> mingw32-make
|
- Import "Existing project into Workspace"
|
||||||
or
|
@figure{/dev_guides/building/android/images/android_image008.png}
|
||||||
> make
|
@figure{/dev_guides/building/android/images/android_image009.png}
|
||||||
|
- Build ALL
|
||||||
|
@figure{/dev_guides/building/android/images/android_image010.png}
|
||||||
Parallel building can be started with using **"-jN"** argument of "mingw32-make/make", where N is the number of building threads.
|
|
||||||
|
When the building process has finished, libraries are located in \<build folder\>/out (e.g. <i> D:/android-build-eclipse-api-15/out </i>).
|
||||||
> mingw32-make -j4
|
|
||||||
or
|
|
||||||
> make -j4
|
|
||||||
|
|
||||||
## Install built OCCT libraries
|
|
||||||
|
|
||||||
Type "mingw32-make/make" with argument "install" to place the libraries
|
|
||||||
to the install folder (see "OCCT Configuration" section of @ref occt_dev_guides__building_cmake "Building with CMake")
|
|
||||||
|
|
||||||
> mingw32-make install
|
|
||||||
or
|
|
||||||
> make install
|
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 70 KiB |
BIN
dox/dev_guides/building/android/images/android_image007.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
dox/dev_guides/building/android/images/android_image008.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
dox/dev_guides/building/android/images/android_image009.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
dox/dev_guides/building/android/images/android_image010.png
Normal file
After Width: | Height: | Size: 46 KiB |
@@ -17,7 +17,7 @@ you need to:
|
|||||||
2. Build using your preferred build tool.
|
2. Build using your preferred build tool.
|
||||||
- \subpage occt_dev_guides__building_automake "Building on Linux with Autotools"
|
- \subpage occt_dev_guides__building_automake "Building on Linux with Autotools"
|
||||||
- \subpage occt_dev_guides__building_cmake "Building with CMake (cross-platform)"
|
- \subpage occt_dev_guides__building_cmake "Building with CMake (cross-platform)"
|
||||||
- \subpage occt_dev_guides__building_android "Building with CMake for Android (cross-platform)"
|
- \subpage occt_dev_guides__building_android "Building with CMake and ADT for Android (cross-platform)"
|
||||||
- \subpage occt_dev_guides__building_code_blocks "Building on Mac OS X with Code::Blocks"
|
- \subpage occt_dev_guides__building_code_blocks "Building on Mac OS X with Code::Blocks"
|
||||||
- \subpage occt_dev_guides__building_msvc "Building on Windows with MS Visual Studio"
|
- \subpage occt_dev_guides__building_msvc "Building on Windows with MS Visual Studio"
|
||||||
- \subpage occt_dev_guides__building_xcode "Building on Mac OS X with Xcode"
|
- \subpage occt_dev_guides__building_xcode "Building on Mac OS X with Xcode"
|
||||||
|
@@ -117,8 +117,8 @@ The following table enumerates the full list of environment variables used at co
|
|||||||
| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
|
| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
|
||||||
| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
|
| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
|
||||||
| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
|
| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
|
||||||
| INSTALL_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
|
| INSTALL_OCCT_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
|
||||||
| INSTALL_SAMPLES | Boolean flag | Indicates whether OCCT samples should be installed into the installation directory |
|
| INSTALL_OCCT_SAMPLES | Boolean flag | Indicates whether OCCT samples should be installed into the installation directory |
|
||||||
| INSTALL_DOC_OcctOverview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
|
| INSTALL_DOC_OcctOverview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
|
||||||
|
|
||||||
**Note:** In those CMake options defining paths only the forward slashes ("/") are acceptable.
|
**Note:** In those CMake options defining paths only the forward slashes ("/") are acceptable.
|
||||||
|
@@ -86,7 +86,7 @@ Alternative solution is to use legacy generator of project files (extracted from
|
|||||||
|
|
||||||
@subsubsection upgrade_occt700_cdl_auto Automatic upgrade
|
@subsubsection upgrade_occt700_cdl_auto Automatic upgrade
|
||||||
|
|
||||||
Most of typical changes required for upgrading code for OCCT 7.0 can be done automatically using the *upgrade* tool included in OCCT 7.0.
|
Most of typical changes required for upgrading code to use OCCT 7.0 can be done automatically using the *upgrade* tool included in OCCT 7.0.
|
||||||
This tool is a Tcl script, thus Tcl should be available on your workstation to run it.
|
This tool is a Tcl script, thus Tcl should be available on your workstation to run it.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -106,16 +106,11 @@ Run upgrade tool without arguments to see the list of available options.
|
|||||||
|
|
||||||
Upgrade tool performs the following changes in the code.
|
Upgrade tool performs the following changes in the code.
|
||||||
|
|
||||||
1. Replaces macro DEFINE_STANDARD_RTTI by DEFINE_STANDARD_RTTIEXT, with second argument indicating base class for the main argument class (if inheritance is recognized by the script):
|
1. Adds second argument to macro DEFINE_STANDARD_RTTI indicating base class for its argument class (if inheritance is recognized by the script):
|
||||||
~~~~~
|
~~~~~
|
||||||
DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTIEXT(Class, Base)
|
DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTI(Class, Base)
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
@note If macro DEFINE_STANDARD_RTTI with two arguments (used in intermediate development versions of OCCT 7.0) is found, the script will convert it to either DEFINE_STANDARD_RTTIEXT or DEFINE_STANDARD_RTTI_INLINE.
|
|
||||||
The former case is used if current file is header and source file with the same name is found in the same folder.
|
|
||||||
In this case, macro IMPLEMENT_STANDARD_RTTI is injected in the corresponding source file.
|
|
||||||
The latter variant defines all methods for RTTI as inline, and does not require IMPLEMENT_STANDARD_RTTIEXT macro.
|
|
||||||
|
|
||||||
2. Replaces forward declarations of collection classes previously generated from CDL generics (defined in TCollection package) by \#include of corresponding header:
|
2. Replaces forward declarations of collection classes previously generated from CDL generics (defined in TCollection package) by \#include of corresponding header:
|
||||||
~~~~~
|
~~~~~
|
||||||
class TColStd_Array1OfReal; -> #include <TColStd_Array1OfReal.hxx>
|
class TColStd_Array1OfReal; -> #include <TColStd_Array1OfReal.hxx>
|
||||||
@@ -164,11 +159,9 @@ Namespace::Handle(Class) -> Handle(Namespace::Class)
|
|||||||
|
|
||||||
10. Adds \#include for all classes used as argument to macro STANDARD_TYPE(), except of already included ones;
|
10. Adds \#include for all classes used as argument to macro STANDARD_TYPE(), except of already included ones;
|
||||||
|
|
||||||
11. Removes uses of obsolete macros IMPLEMENT_DOWNCAST and IMPLEMENT_STANDARD_*, except IMPLEMENT_STANDARD_RTTIEXT.
|
11. Removes uses of obsolete macros IMPLEMENT_DOWNCAST() and IMPLEMENT_STANDARD_*().
|
||||||
|
|
||||||
@note If you plan to keep compatibility of your code with older versions of OCCT, add option "-compat" to avoid the latter change. See also @ref upgrade_occt700_cdl_compat.
|
> If you plan to keep compatibility of your code with older versions of OCCT, add option "-compat" to avoid the latter change. See also @ref upgrade_occt700_cdl_compat.
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
As long as the upgrade routine runs, some information messages are sent to the standard output.
|
As long as the upgrade routine runs, some information messages are sent to the standard output.
|
||||||
In some cases the warnings or errors like the following may appear:
|
In some cases the warnings or errors like the following may appear:
|
||||||
@@ -178,7 +171,7 @@ In some cases the warnings or errors like the following may appear:
|
|||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
Be sure to check carefully all reported errors and warnings, as corresponding places likely will require manual corrections.
|
Be sure to check carefully all reported errors and warnings, as corresponding places likely will require manual corrections.
|
||||||
In some cases these messages may help you to detect errors in your code, for instance, cases where DEFINE_STANDARD_RTTI macro is used with incorrect class name as an argument.
|
In some cases these messages may help you to detect errors in your code, for instance, cases where DEFINE_STANDARD_RTTI macro passes invalid class name as an argument.
|
||||||
|
|
||||||
@subsubsection upgrade_occt700_cdl_compiler Possible compiler errors
|
@subsubsection upgrade_occt700_cdl_compiler Possible compiler errors
|
||||||
|
|
||||||
@@ -330,17 +323,16 @@ aBC->Transform (T); // access violation in OCCT 7.0
|
|||||||
|
|
||||||
If you like to preserve compatibility of your application code with OCCT versions 6.x even after upgrade to 7.0, consider the following suggestions:
|
If you like to preserve compatibility of your application code with OCCT versions 6.x even after upgrade to 7.0, consider the following suggestions:
|
||||||
|
|
||||||
1. If your code used sequences of macros IMPLEMENT_STANDARD_... generated by WOK, replace them by single macro IMPLEMENT_STANDARD_RTTIEXT
|
1. When running automatic upgrade tool, add option *-compat*.
|
||||||
|
|
||||||
2. When running automatic upgrade tool, add option *-compat*.
|
2. In order to overcome incompatibility of macro DEFINE_STANDARD_RTTI which has additional argument in OCCT 7.0, you can replace (after upgrade) its use in your code by your own version-dependent macro, which resolves to either 6.x or 7.x version.
|
||||||
|
|
||||||
3. Define macros DEFINE_STANDARD_RTTIEXT and DEFINE_STANDARD_RTTI_INLINE when building with previous versions of OCCT, resolving to DEFINE_STANDARD_RTTI with single argument
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
~~~~~
|
~~~~~
|
||||||
#if OCC_VERSION_HEX < 0x070000
|
#if OCC_VERSION_HEX < 0x070000
|
||||||
#define DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTI(C1)
|
#define DEFINE_STANDARD_RTTI_COMPAT(C1,C2) DEFINE_STANDARD_RTTI(C1)
|
||||||
#define DEFINE_STANDARD_RTTI_INLINE(C1,C2) DEFINE_STANDARD_RTTI(C1)
|
#else
|
||||||
|
#define DEFINE_STANDARD_RTTI_COMPAT(C1,C2) DEFINE_STANDARD_RTTI(C1,C2)
|
||||||
#endif
|
#endif
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
|
@@ -7,8 +7,6 @@ SET "OLD_PATH=%PATH%"
|
|||||||
|
|
||||||
if exist "%~dp0env.bat" (
|
if exist "%~dp0env.bat" (
|
||||||
call "%~dp0env.bat"
|
call "%~dp0env.bat"
|
||||||
) else (
|
|
||||||
type "%~dp0adm\templates\env.bat" | findstr /i /v "__CASROOT__" > "%~dp0env.bat"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set "TCL_EXEC=tclsh.exe"
|
set "TCL_EXEC=tclsh.exe"
|
||||||
|
@@ -9,9 +9,6 @@ anOldDyLd="$DYLD_LIBRARY_PATH"
|
|||||||
|
|
||||||
# go to the script directory
|
# go to the script directory
|
||||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
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
|
|
||||||
fi
|
|
||||||
|
|
||||||
aSystem=`uname -s`
|
aSystem=`uname -s`
|
||||||
aTarget="$1"
|
aTarget="$1"
|
||||||
|
@@ -530,7 +530,7 @@ public:
|
|||||||
theRed=255;
|
theRed=255;
|
||||||
theGreen=255;
|
theGreen=255;
|
||||||
theBlue=255;
|
theBlue=255;
|
||||||
Handle(AIS_InteractiveObject) aCurrent ;
|
Handle_AIS_InteractiveObject aCurrent ;
|
||||||
Quantity_Color anObjCol;
|
Quantity_Color anObjCol;
|
||||||
myAISContext()->InitCurrent();
|
myAISContext()->InitCurrent();
|
||||||
if (!myAISContext()->MoreCurrent())
|
if (!myAISContext()->MoreCurrent())
|
||||||
@@ -716,7 +716,7 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///Get AISContext
|
///Get AISContext
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Handle(AIS_InteractiveContext) GetContext(void)
|
Handle_AIS_InteractiveContext GetContext(void)
|
||||||
{
|
{
|
||||||
return myAISContext();
|
return myAISContext();
|
||||||
}
|
}
|
||||||
@@ -841,8 +841,8 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
|
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
|
||||||
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast(anIO);
|
Handle_AIS_Shape anIS = Handle_AIS_Shape::DownCast(anIO);
|
||||||
return BRepTools::Write (anIS->Shape(), (Standard_CString)theFileName) != Standard_False;
|
return BRepTools::Write (anIS->Shape(), (Standard_CString)theFileName) != Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -857,8 +857,8 @@ public:
|
|||||||
STEPControl_Writer aWriter;
|
STEPControl_Writer aWriter;
|
||||||
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
|
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
|
||||||
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
|
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
|
||||||
TopoDS_Shape aShape = anIS->Shape();
|
TopoDS_Shape aShape = anIS->Shape();
|
||||||
aStatus = aWriter.Transfer( aShape , aType );
|
aStatus = aWriter.Transfer( aShape , aType );
|
||||||
if ( aStatus != IFSelect_RetDone )
|
if ( aStatus != IFSelect_RetDone )
|
||||||
@@ -888,8 +888,8 @@ public:
|
|||||||
|
|
||||||
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
|
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
|
||||||
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
|
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
|
||||||
TopoDS_Shape aShape = anIS->Shape();
|
TopoDS_Shape aShape = anIS->Shape();
|
||||||
aWriter.AddShape ( aShape );
|
aWriter.AddShape ( aShape );
|
||||||
}
|
}
|
||||||
@@ -910,8 +910,8 @@ public:
|
|||||||
|
|
||||||
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
|
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
|
||||||
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
|
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
|
||||||
TopoDS_Shape aShape = anIS->Shape();
|
TopoDS_Shape aShape = anIS->Shape();
|
||||||
if ( aShape.IsNull() )
|
if ( aShape.IsNull() )
|
||||||
{
|
{
|
||||||
@@ -939,8 +939,8 @@ public:
|
|||||||
|
|
||||||
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
|
Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
|
||||||
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
|
Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
|
||||||
TopoDS_Shape aShape = anIS->Shape();
|
TopoDS_Shape aShape = anIS->Shape();
|
||||||
if ( aShape.IsNull() )
|
if ( aShape.IsNull() )
|
||||||
{
|
{
|
||||||
@@ -1030,8 +1030,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// fields
|
// fields
|
||||||
NCollection_Haft<Handle(V3d_Viewer)> myViewer;
|
NCollection_Haft<Handle_V3d_Viewer> myViewer;
|
||||||
NCollection_Haft<Handle(V3d_View)> myView;
|
NCollection_Haft<Handle_V3d_View> myView;
|
||||||
NCollection_Haft<Handle(AIS_InteractiveContext)> myAISContext;
|
NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
|
||||||
NCollection_Haft<Handle(OpenGl_GraphicDriver)> myGraphicDriver;
|
NCollection_Haft<Handle_OpenGl_GraphicDriver> myGraphicDriver;
|
||||||
};
|
};
|
||||||
|
@@ -693,7 +693,7 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///Get AISContext
|
///Get AISContext
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Handle(AIS_InteractiveContext) GetContext()
|
Handle_AIS_InteractiveContext GetContext()
|
||||||
{
|
{
|
||||||
return myAISContext();
|
return myAISContext();
|
||||||
}
|
}
|
||||||
@@ -965,9 +965,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
NCollection_Haft<Handle(V3d_Viewer)> myViewer;
|
NCollection_Haft<Handle_V3d_Viewer> myViewer;
|
||||||
NCollection_Haft<Handle(V3d_View)> myView;
|
NCollection_Haft<Handle_V3d_View> myView;
|
||||||
NCollection_Haft<Handle(AIS_InteractiveContext)> myAISContext;
|
NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
|
||||||
NCollection_Haft<Handle(D3DHost_GraphicDriver)> myGraphicDriver;
|
NCollection_Haft<Handle_D3DHost_GraphicDriver> myGraphicDriver;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE (OcctJni_MsgPrinter, Message_Printer)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_MsgPrinter, Message_Printer)
|
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_MsgPrinter, Message_Printer)
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@@ -53,7 +53,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(OcctJni_MsgPrinter,Message_Printer)
|
DEFINE_STANDARD_RTTI(OcctJni_MsgPrinter)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -13,4 +13,5 @@
|
|||||||
|
|
||||||
#include <OcctJni_Window.hxx>
|
#include <OcctJni_Window.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE (OcctJni_Window, Aspect_Window)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_Window, Aspect_Window)
|
IMPLEMENT_STANDARD_RTTIEXT(OcctJni_Window, Aspect_Window)
|
||||||
|
@@ -97,7 +97,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(OcctJni_Window,Aspect_Window)
|
DEFINE_STANDARD_RTTI(OcctJni_Window)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -153,7 +153,7 @@ static TCollection_AsciiString Comment(Standard_Real Step,
|
|||||||
"GeomAPI_PointsToBSplineSurface aPTBS;" EOL
|
"GeomAPI_PointsToBSplineSurface aPTBS;" EOL
|
||||||
"aPTBS.Init(aZPoints,aX0,aXStep,aY0,aYStep," EOL
|
"aPTBS.Init(aZPoints,aX0,aXStep,aY0,aYStep," EOL
|
||||||
" DegMin,DegMax,Continuity,Tolerance);" EOL
|
" DegMin,DegMax,Continuity,Tolerance);" EOL
|
||||||
"Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();" EOL EOL EOL
|
"Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();" EOL EOL EOL
|
||||||
);
|
);
|
||||||
|
|
||||||
return aText;
|
return aText;
|
||||||
@@ -165,7 +165,7 @@ static TCollection_AsciiString Comment(Standard_Real Step,
|
|||||||
// Purpose :
|
// Purpose :
|
||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
|
Handle_Geom_BSplineSurface Approx_Presentation::CreateBSplineSurface(TColStd_Array2OfReal& aZPoints,
|
||||||
Standard_Real theXStep,
|
Standard_Real theXStep,
|
||||||
Standard_Real theYStep,
|
Standard_Real theYStep,
|
||||||
Standard_Integer Count)
|
Standard_Integer Count)
|
||||||
@@ -175,7 +175,7 @@ Handle(Geom_BSplineSurface) Approx_Presentation::CreateBSplineSurface(TColStd_Ar
|
|||||||
GeomAPI_PointsToBSplineSurface aPTBS;
|
GeomAPI_PointsToBSplineSurface aPTBS;
|
||||||
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
|
aPTBS.Init(aZPoints,aX0,theXStep,aY0,theYStep,
|
||||||
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||||
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
|
Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();
|
||||||
|
|
||||||
return aSurface;
|
return aSurface;
|
||||||
}
|
}
|
||||||
@@ -192,12 +192,12 @@ Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfR
|
|||||||
Standard_Integer theIndexX,
|
Standard_Integer theIndexX,
|
||||||
Standard_Integer theIndexY,
|
Standard_Integer theIndexY,
|
||||||
Standard_Real theDeflection,
|
Standard_Real theDeflection,
|
||||||
Handle(AIS_InteractiveObject)& aMovePnt,
|
Handle_AIS_InteractiveObject& aMovePnt,
|
||||||
Handle(AIS_InteractiveObject)& aObj,
|
Handle_AIS_InteractiveObject& aObj,
|
||||||
Standard_Integer Count)
|
Standard_Integer Count)
|
||||||
|
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) auxObj;
|
Handle_AIS_InteractiveObject auxObj;
|
||||||
Standard_Real aX0 = -300, aY0 = -200;
|
Standard_Real aX0 = -300, aY0 = -200;
|
||||||
Standard_Real aLastZ = aZPoints(theIndexX,theIndexY);
|
Standard_Real aLastZ = aZPoints(theIndexX,theIndexY);
|
||||||
aZPoints(theIndexX,theIndexY) += 100*theDeflection;
|
aZPoints(theIndexX,theIndexY) += 100*theDeflection;
|
||||||
@@ -216,7 +216,7 @@ Standard_Boolean Approx_Presentation::DrawModifyBSplineSurface(TColStd_Array2OfR
|
|||||||
|
|
||||||
aZPoints(theIndexX,theIndexY) = aLastZ;
|
aZPoints(theIndexX,theIndexY) = aLastZ;
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aSurface = aPTBS.Surface();
|
Handle_Geom_BSplineSurface aSurface = aPTBS.Surface();
|
||||||
|
|
||||||
auxObj = drawSurface(aSurface);
|
auxObj = drawSurface(aSurface);
|
||||||
getAISContext()->Erase(aObj);
|
getAISContext()->Erase(aObj);
|
||||||
@@ -275,7 +275,7 @@ void Approx_Presentation::sample1()
|
|||||||
|
|
||||||
aText += (
|
aText += (
|
||||||
"aPTB.Init(aCurvePoint,DegMin,DegMax,Continuity,Tolerance);" EOL
|
"aPTB.Init(aCurvePoint,DegMin,DegMax,Continuity,Tolerance);" EOL
|
||||||
"Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();" EOL
|
"Handle_Geom_BSplineCurve aCurve = aPTB.Curve();" EOL
|
||||||
);
|
);
|
||||||
|
|
||||||
setResultTitle("Creating approximations of curves");
|
setResultTitle("Creating approximations of curves");
|
||||||
@@ -295,7 +295,7 @@ void Approx_Presentation::sample1()
|
|||||||
|
|
||||||
GeomAPI_PointsToBSpline aPTB;
|
GeomAPI_PointsToBSpline aPTB;
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aIndexPnt [2],aObj;
|
Handle_AIS_InteractiveObject aIndexPnt [2],aObj;
|
||||||
Standard_Integer aIndex[2] = {9,13};
|
Standard_Integer aIndex[2] = {9,13};
|
||||||
Standard_Real aDeflection[2] = {-1.5,2};
|
Standard_Real aDeflection[2] = {-1.5,2};
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ void Approx_Presentation::sample1()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
aPTB.Init(aCurvePoint,DegMin[Count],DegMax[Count],Continuity[Count],Tol[Count]);
|
||||||
Handle(Geom_BSplineCurve) aCurve = aPTB.Curve();
|
Handle_Geom_BSplineCurve aCurve = aPTB.Curve();
|
||||||
aObj = drawCurve(aCurve);
|
aObj = drawCurve(aCurve);
|
||||||
|
|
||||||
for( i = 0 ; i < 2 ; i++)
|
for( i = 0 ; i < 2 ; i++)
|
||||||
@@ -367,7 +367,7 @@ void Approx_Presentation::sample2()
|
|||||||
|
|
||||||
|
|
||||||
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
||||||
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
|
Handle_AIS_InteractiveObject aShowPnt[4][4],aObj,aMovePnt;
|
||||||
|
|
||||||
Standard_Integer aColLength = aZPoints.ColLength();
|
Standard_Integer aColLength = aZPoints.ColLength();
|
||||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||||
@@ -404,7 +404,7 @@ void Approx_Presentation::sample2()
|
|||||||
aText = Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
aText = Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||||
setResultText(aText.ToCString());
|
setResultText(aText.ToCString());
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||||
aObj = drawSurface(aSurface);
|
aObj = drawSurface(aSurface);
|
||||||
Standard_Boolean aBool;
|
Standard_Boolean aBool;
|
||||||
if(WAIT_A_LITTLE) return ;
|
if(WAIT_A_LITTLE) return ;
|
||||||
@@ -452,7 +452,7 @@ void Approx_Presentation::sample3()
|
|||||||
|
|
||||||
|
|
||||||
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
TColgp_Array2OfPnt aPnt(1,4,1,4);
|
||||||
Handle(AIS_InteractiveObject) aShowPnt[4][4],aObj,aMovePnt;
|
Handle_AIS_InteractiveObject aShowPnt[4][4],aObj,aMovePnt;
|
||||||
|
|
||||||
Standard_Integer aColLength = aZPoints.ColLength();
|
Standard_Integer aColLength = aZPoints.ColLength();
|
||||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||||
@@ -491,7 +491,7 @@ void Approx_Presentation::sample3()
|
|||||||
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||||
setResultText(aText.ToCString());
|
setResultText(aText.ToCString());
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||||
aObj = drawSurface(aSurface);
|
aObj = drawSurface(aSurface);
|
||||||
Standard_Boolean aBool;
|
Standard_Boolean aBool;
|
||||||
if(WAIT_A_LITTLE) return ;
|
if(WAIT_A_LITTLE) return ;
|
||||||
@@ -540,7 +540,7 @@ void Approx_Presentation::sample4()
|
|||||||
|
|
||||||
|
|
||||||
TColgp_Array2OfPnt aPnt(1,5,1,5);
|
TColgp_Array2OfPnt aPnt(1,5,1,5);
|
||||||
Handle(AIS_InteractiveObject) aShowPnt[5][5],aObj,aMovePnt;
|
Handle_AIS_InteractiveObject aShowPnt[5][5],aObj,aMovePnt;
|
||||||
|
|
||||||
Standard_Integer aColLength = aZPoints.ColLength();
|
Standard_Integer aColLength = aZPoints.ColLength();
|
||||||
Standard_Integer aRowLength = aZPoints.RowLength();
|
Standard_Integer aRowLength = aZPoints.RowLength();
|
||||||
@@ -579,7 +579,7 @@ void Approx_Presentation::sample4()
|
|||||||
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
aText += Comment(aXStep,anUpper,DegMin[Count],DegMax[Count],Count+1,Tol[Count]);
|
||||||
setResultText(aText.ToCString());
|
setResultText(aText.ToCString());
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
Handle_Geom_BSplineSurface aSurface = CreateBSplineSurface(aZPoints,aXStep,aYStep,Count);
|
||||||
aObj = drawSurface(aSurface);
|
aObj = drawSurface(aSurface);
|
||||||
Standard_Boolean aBool;
|
Standard_Boolean aBool;
|
||||||
if(WAIT_A_LITTLE) return ;
|
if(WAIT_A_LITTLE) return ;
|
||||||
|
@@ -32,11 +32,11 @@ private:
|
|||||||
Standard_Boolean DrawModifyBSplineSurface(TColStd_Array2OfReal& ,
|
Standard_Boolean DrawModifyBSplineSurface(TColStd_Array2OfReal& ,
|
||||||
Standard_Real ,Standard_Real ,
|
Standard_Real ,Standard_Real ,
|
||||||
Standard_Integer ,Standard_Integer ,
|
Standard_Integer ,Standard_Integer ,
|
||||||
Standard_Real,Handle(AIS_InteractiveObject)&,
|
Standard_Real,Handle_AIS_InteractiveObject&,
|
||||||
Handle(AIS_InteractiveObject)&,
|
Handle_AIS_InteractiveObject&,
|
||||||
Standard_Integer);
|
Standard_Integer);
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) CreateBSplineSurface(TColStd_Array2OfReal& ,
|
Handle_Geom_BSplineSurface CreateBSplineSurface(TColStd_Array2OfReal& ,
|
||||||
Standard_Real ,Standard_Real,
|
Standard_Real ,Standard_Real,
|
||||||
Standard_Integer);
|
Standard_Integer);
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ Standard_Boolean Chamfers_Presentation::createDiverseChamferOnBox(
|
|||||||
Standard_Real d1, // chamfer on edge 1
|
Standard_Real d1, // chamfer on edge 1
|
||||||
Standard_Real d2, // chamfer on edge 2
|
Standard_Real d2, // chamfer on edge 2
|
||||||
Standard_Real d3, // chamfer on edge 3
|
Standard_Real d3, // chamfer on edge 3
|
||||||
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
|
Handle_AIS_InteractiveObject& thePrevShape)// for smoth drawing
|
||||||
// we display the new shape first, then erase the previous one
|
// we display the new shape first, then erase the previous one
|
||||||
{
|
{
|
||||||
// initializing a class that builds chamfer
|
// initializing a class that builds chamfer
|
||||||
@@ -202,7 +202,7 @@ Standard_Boolean Chamfers_Presentation::createChamferOnBox(
|
|||||||
TopoDS_Solid& aBox,
|
TopoDS_Solid& aBox,
|
||||||
Standard_Real theDistA, // distance along first face
|
Standard_Real theDistA, // distance along first face
|
||||||
Standard_Real theDistB, // distance along second face
|
Standard_Real theDistB, // distance along second face
|
||||||
Handle(AIS_InteractiveObject)& thePrevShape)// for smoth drawing
|
Handle_AIS_InteractiveObject& thePrevShape)// for smoth drawing
|
||||||
// we display the new shape first, then erase the previous one
|
// we display the new shape first, then erase the previous one
|
||||||
{
|
{
|
||||||
// initializing a class that builds chamfer
|
// initializing a class that builds chamfer
|
||||||
@@ -287,7 +287,7 @@ Standard_Boolean Chamfers_Presentation::createFilletOnBox(
|
|||||||
TopoDS_Solid& aBox,
|
TopoDS_Solid& aBox,
|
||||||
Standard_Real theRad, // radius of fillet
|
Standard_Real theRad, // radius of fillet
|
||||||
ChFi3d_FilletShape theFShape, // shape of fillet
|
ChFi3d_FilletShape theFShape, // shape of fillet
|
||||||
Handle(AIS_InteractiveObject)& thePrevObj) // to erase
|
Handle_AIS_InteractiveObject& thePrevObj) // to erase
|
||||||
// the previous shape
|
// the previous shape
|
||||||
{
|
{
|
||||||
// initializing a class that builds fillet
|
// initializing a class that builds fillet
|
||||||
@@ -612,7 +612,7 @@ void Chamfers_Presentation::sampleBoxFillet()
|
|||||||
Standard_Real a = BOX_SIDE_LEN;
|
Standard_Real a = BOX_SIDE_LEN;
|
||||||
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
|
TopoDS_Solid aBox = BRepPrimAPI_MakeBox(gp_Pnt(-a/2, -a/2, -a/2), a, a, a);
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aPrevObj = new AIS_Shape(aBox);
|
Handle_AIS_InteractiveObject aPrevObj = new AIS_Shape(aBox);
|
||||||
getAISContext()->Display(aPrevObj, Standard_False);
|
getAISContext()->Display(aPrevObj, Standard_False);
|
||||||
COCCDemoDoc::Fit();
|
COCCDemoDoc::Fit();
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
#include <ChFi3d_FilletShape.hxx>
|
#include <ChFi3d_FilletShape.hxx>
|
||||||
|
|
||||||
class AIS_InteractiveObject;
|
class Handle_AIS_InteractiveObject;
|
||||||
class TopoDS_Solid;
|
class TopoDS_Solid;
|
||||||
|
|
||||||
class Chamfers_Presentation : public OCCDemo_Presentation
|
class Chamfers_Presentation : public OCCDemo_Presentation
|
||||||
@@ -29,15 +29,15 @@ public:
|
|||||||
private:
|
private:
|
||||||
Standard_Boolean createChamferOnBox(
|
Standard_Boolean createChamferOnBox(
|
||||||
TopoDS_Solid&, Standard_Real, Standard_Real,
|
TopoDS_Solid&, Standard_Real, Standard_Real,
|
||||||
Handle(AIS_InteractiveObject)&);
|
Handle_AIS_InteractiveObject&);
|
||||||
|
|
||||||
Standard_Boolean createDiverseChamferOnBox(
|
Standard_Boolean createDiverseChamferOnBox(
|
||||||
TopoDS_Solid&, Standard_Real, Standard_Real,
|
TopoDS_Solid&, Standard_Real, Standard_Real,
|
||||||
Standard_Real, Handle(AIS_InteractiveObject)&);
|
Standard_Real, Handle_AIS_InteractiveObject&);
|
||||||
|
|
||||||
Standard_Boolean createFilletOnBox(
|
Standard_Boolean createFilletOnBox(
|
||||||
TopoDS_Solid&, Standard_Real, ChFi3d_FilletShape,
|
TopoDS_Solid&, Standard_Real, ChFi3d_FilletShape,
|
||||||
Handle(AIS_InteractiveObject)&);
|
Handle_AIS_InteractiveObject&);
|
||||||
|
|
||||||
// Sample functions
|
// Sample functions
|
||||||
void sampleBoxChamfer();
|
void sampleBoxChamfer();
|
||||||
|
@@ -11,25 +11,28 @@
|
|||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||||
|
IMPLEMENT_STANDARD_RTTI(ISession_Curve,AIS_InteractiveObject)
|
||||||
//
|
//
|
||||||
// Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and
|
// Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and
|
||||||
// a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro.
|
// a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro.
|
||||||
// We must respect the order: from the direct ancestor class
|
// We must respect the order: from the direct ancestor class
|
||||||
// to the base class.
|
// to the base class.
|
||||||
//
|
//
|
||||||
|
IMPLEMENT_STANDARD_TYPE(ISession_Curve)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE(AIS_InteractiveObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE(SelectMgr_SelectableObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE(PrsMgr_PresentableObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(AIS_InteractiveObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(SelectMgr_SelectableObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(PrsMgr_PresentableObject)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient)
|
||||||
|
IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
|
||||||
|
IMPLEMENT_STANDARD_TYPE_END(ISession_Curve)
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#undef THIS_FILE
|
#undef THIS_FILE
|
||||||
|
@@ -20,7 +20,7 @@ class ISession_Curve : public AIS_InteractiveObject
|
|||||||
public:
|
public:
|
||||||
ISession_Curve(const Handle(Geom_Curve)& aCurve);
|
ISession_Curve(const Handle(Geom_Curve)& aCurve);
|
||||||
virtual ~ISession_Curve();
|
virtual ~ISession_Curve();
|
||||||
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(ISession_Curve)
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
|
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
|
||||||
|
@@ -77,8 +77,8 @@ static Standard_Boolean fixParam(Standard_Real& theParam)
|
|||||||
// Purpose : displays a given geometric surface in 3d viewer
|
// Purpose : displays a given geometric surface in 3d viewer
|
||||||
// (creates a finite face and displays it)
|
// (creates a finite face and displays it)
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
|
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
|
||||||
(const Handle(Geom_Surface)& theSurface,
|
(const Handle_Geom_Surface& theSurface,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
@@ -89,7 +89,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
|
|||||||
fixParam(v1);
|
fixParam(v1);
|
||||||
fixParam(v2);
|
fixParam(v2);
|
||||||
|
|
||||||
Handle(AIS_Shape) aGraphicSurface =
|
Handle_AIS_Shape aGraphicSurface =
|
||||||
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
|
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
|
||||||
|
|
||||||
getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
|
getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
|
||||||
@@ -110,8 +110,8 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
|
|||||||
// Function : DrawCurve
|
// Function : DrawCurve
|
||||||
// Purpose : displays a given curve 3d
|
// Purpose : displays a given curve 3d
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
|
||||||
(const Handle(Geom_Curve)& theCurve,
|
(const Handle_Geom_Curve& theCurve,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
@@ -135,8 +135,8 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
|||||||
// Function : DrawCurve
|
// Function : DrawCurve
|
||||||
// Purpose : displays a given curve 2d
|
// Purpose : displays a given curve 2d
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawCurve
|
||||||
(const Handle(Geom2d_Curve)& theCurve,
|
(const Handle_Geom2d_Curve& theCurve,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay,
|
const Standard_Boolean toDisplay,
|
||||||
const gp_Ax2& aPosition)
|
const gp_Ax2& aPosition)
|
||||||
@@ -163,7 +163,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
|
|||||||
// Function : drawPoint
|
// Function : drawPoint
|
||||||
// Purpose : displays a given point
|
// Purpose : displays a given point
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_Point) OCCDemo_Presentation::drawPoint
|
Handle_AIS_Point OCCDemo_Presentation::drawPoint
|
||||||
(const gp_Pnt& aPnt,
|
(const gp_Pnt& aPnt,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
@@ -185,7 +185,7 @@ Handle(AIS_Point) OCCDemo_Presentation::drawPoint
|
|||||||
// (segment of line starting at thePnt with the arrow at the end,
|
// (segment of line starting at thePnt with the arrow at the end,
|
||||||
// the length of segment is the length of the vector)
|
// the length of segment is the length of the vector)
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
|
Handle_AIS_InteractiveObject OCCDemo_Presentation::drawVector
|
||||||
(const gp_Pnt& thePnt,
|
(const gp_Pnt& thePnt,
|
||||||
const gp_Vec& theVec,
|
const gp_Vec& theVec,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
@@ -217,11 +217,11 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
|
Handle_AIS_Shape OCCDemo_Presentation::drawShape
|
||||||
(const TopoDS_Shape& theShape,const Quantity_Color& theColor,
|
(const TopoDS_Shape& theShape,const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
|
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
|
||||||
|
|
||||||
getAISContext()->SetMaterial(aGraphicShape, Graphic3d_NOM_PLASTIC, toDisplay);
|
getAISContext()->SetMaterial(aGraphicShape, Graphic3d_NOM_PLASTIC, toDisplay);
|
||||||
getAISContext()->SetColor (aGraphicShape, theColor, toDisplay);
|
getAISContext()->SetColor (aGraphicShape, theColor, toDisplay);
|
||||||
@@ -237,12 +237,12 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
|
|||||||
return aGraphicShape;
|
return aGraphicShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_Shape) OCCDemo_Presentation::drawShape
|
Handle_AIS_Shape OCCDemo_Presentation::drawShape
|
||||||
(const TopoDS_Shape& theShape,
|
(const TopoDS_Shape& theShape,
|
||||||
const Graphic3d_NameOfMaterial theMaterial,
|
const Graphic3d_NameOfMaterial theMaterial,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
|
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
|
||||||
|
|
||||||
getAISContext()->SetMaterial(aGraphicShape, theMaterial, toDisplay);
|
getAISContext()->SetMaterial(aGraphicShape, theMaterial, toDisplay);
|
||||||
if (toDisplay) {
|
if (toDisplay) {
|
||||||
|
@@ -14,10 +14,10 @@
|
|||||||
#define WAIT_A_SECOND WaitForInput(1000)
|
#define WAIT_A_SECOND WaitForInput(1000)
|
||||||
|
|
||||||
#include <OCCDemoDoc.h>
|
#include <OCCDemoDoc.h>
|
||||||
class AIS_InteractiveObject;
|
class Handle_AIS_InteractiveObject;
|
||||||
class Geom_Surface;
|
class Handle_Geom_Surface;
|
||||||
class Geom_Curve;
|
class Handle_Geom_Curve;
|
||||||
class Geom2d_Curve;
|
class Handle_Geom2d_Curve;
|
||||||
class Quantity_Color;
|
class Quantity_Color;
|
||||||
|
|
||||||
class OCCDemo_Presentation
|
class OCCDemo_Presentation
|
||||||
@@ -63,8 +63,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// Methods to call from a derivable class
|
// Methods to call from a derivable class
|
||||||
void setName (const char* theName) {myName = CString(theName);}
|
void setName (const char* theName) {myName = CString(theName);}
|
||||||
Handle(AIS_InteractiveContext) getAISContext() const {return myDoc->GetAISContext();}
|
Handle_AIS_InteractiveContext getAISContext() const {return myDoc->GetAISContext();}
|
||||||
Handle(V3d_Viewer) getViewer() const {return myDoc->GetViewer();}
|
Handle_V3d_Viewer getViewer() const {return myDoc->GetViewer();}
|
||||||
void setResultTitle (const char* theTitle) {myDoc->GetResultDialog()->SetTitle(theTitle);}
|
void setResultTitle (const char* theTitle) {myDoc->GetResultDialog()->SetTitle(theTitle);}
|
||||||
void setResultText (const char* theText) {myDoc->GetResultDialog()->SetText(theText);}
|
void setResultText (const char* theText) {myDoc->GetResultDialog()->SetText(theText);}
|
||||||
Standard_CString GetDataDir() {return myDoc->GetDataDir();}
|
Standard_CString GetDataDir() {return myDoc->GetDataDir();}
|
||||||
@@ -72,45 +72,45 @@ protected:
|
|||||||
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
||||||
// Waits for a user input or a period of time has been elapsed
|
// Waits for a user input or a period of time has been elapsed
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawSurface (const Handle(Geom_Surface)& theSurface,
|
Handle_AIS_InteractiveObject drawSurface (const Handle_Geom_Surface& theSurface,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a finite face based on the given geometric surface
|
// creates a finite face based on the given geometric surface
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom_Curve)& theCurve,
|
Handle_AIS_InteractiveObject drawCurve (const Handle_Geom_Curve& theCurve,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates an ISession_Curve based on the given geometric curve
|
// creates an ISession_Curve based on the given geometric curve
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom2d_Curve)& theCurve,
|
Handle_AIS_InteractiveObject drawCurve (const Handle_Geom2d_Curve& theCurve,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
|
||||||
const Standard_Boolean toDisplay = Standard_True,
|
const Standard_Boolean toDisplay = Standard_True,
|
||||||
const gp_Ax2& aPosition = gp::XOY());
|
const gp_Ax2& aPosition = gp::XOY());
|
||||||
// converts a given curve to 3d using aPosition and calls the previous method
|
// converts a given curve to 3d using aPosition and calls the previous method
|
||||||
|
|
||||||
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
|
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given point
|
// creates a presentation of the given point
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawVector (const gp_Pnt& thePnt,
|
Handle_AIS_InteractiveObject drawVector (const gp_Pnt& thePnt,
|
||||||
const gp_Vec& theVec,
|
const gp_Vec& theVec,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given vector
|
// creates a presentation of the given vector
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
|
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given shape
|
// creates a presentation of the given shape
|
||||||
// with material PLASTIC and a given color
|
// with material PLASTIC and a given color
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
|
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
|
||||||
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given shape with the given material
|
// creates a presentation of the given shape with the given material
|
||||||
|
@@ -23,7 +23,7 @@ class COCCDemoApp : public CWinApp
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
COCCDemoApp();
|
COCCDemoApp();
|
||||||
Handle(Graphic3d_WNTGraphicDevice) GetGraphicDevice() const
|
Handle_Graphic3d_WNTGraphicDevice GetGraphicDevice() const
|
||||||
{ return myGraphicDevice; } ;
|
{ return myGraphicDevice; } ;
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle(Graphic3d_WNTGraphicDevice) myGraphicDevice;
|
Handle_Graphic3d_WNTGraphicDevice myGraphicDevice;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -15,8 +15,8 @@ class OCCDemo_Presentation;
|
|||||||
class COCCDemoDoc : public CDocument
|
class COCCDemoDoc : public CDocument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Handle(V3d_Viewer) GetViewer() const { return myViewer; };
|
Handle_V3d_Viewer GetViewer() const { return myViewer; };
|
||||||
Handle(AIS_InteractiveContext) GetAISContext() const { return myAISContext; };
|
Handle_AIS_InteractiveContext GetAISContext() const { return myAISContext; };
|
||||||
CResultDialog* GetResultDialog () {return &myCResultDialog;}
|
CResultDialog* GetResultDialog () {return &myCResultDialog;}
|
||||||
Standard_CString GetDataDir() {return myDataDir;}
|
Standard_CString GetDataDir() {return myDataDir;}
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@ protected:
|
|||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle(V3d_Viewer) myViewer;
|
Handle_V3d_Viewer myViewer;
|
||||||
Handle(AIS_InteractiveContext) myAISContext;
|
Handle_AIS_InteractiveContext myAISContext;
|
||||||
OCCDemo_Presentation *myPresentation;
|
OCCDemo_Presentation *myPresentation;
|
||||||
CResultDialog myCResultDialog;
|
CResultDialog myCResultDialog;
|
||||||
BOOL myShowResult;
|
BOOL myShowResult;
|
||||||
|
@@ -103,8 +103,8 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
|
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
|
||||||
Handle(V3d_View) myView;
|
Handle_V3d_View myView;
|
||||||
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
|
Handle_Graphic3d_GraphicDriver myGraphicDriver;
|
||||||
View3D_CurrentAction myCurrentMode;
|
View3D_CurrentAction myCurrentMode;
|
||||||
VisMode myVisMode;
|
VisMode myVisMode;
|
||||||
Standard_Integer myXmin;
|
Standard_Integer myXmin;
|
||||||
|
@@ -88,7 +88,7 @@ void Convert_Presentation::DoSample()
|
|||||||
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
|
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
|
||||||
// Purpose :
|
// Purpose :
|
||||||
//================================================================
|
//================================================================
|
||||||
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurface,
|
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurface,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
TCollection_AsciiString& theText)
|
TCollection_AsciiString& theText)
|
||||||
{
|
{
|
||||||
@@ -97,7 +97,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurf
|
|||||||
aTitle += " to BSpline surface";
|
aTitle += " to BSpline surface";
|
||||||
|
|
||||||
theText += EOL
|
theText += EOL
|
||||||
" Handle(Geom_BSplineSurface) aBSplineSurface = " EOL
|
" Handle_Geom_BSplineSurface aBSplineSurface = " EOL
|
||||||
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
|
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
|
||||||
|
|
||||||
setResultTitle (aTitle.ToCString());
|
setResultTitle (aTitle.ToCString());
|
||||||
@@ -107,7 +107,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurf
|
|||||||
|
|
||||||
if (WAIT_A_LITTLE) return;
|
if (WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
|
Handle_Geom_BSplineSurface aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
|
||||||
|
|
||||||
_ASSERTE(!aBSplineSurface.IsNull());
|
_ASSERTE(!aBSplineSurface.IsNull());
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ void Convert_Presentation::drawSurfaceAndItsBSpline(Handle(Geom_Surface) theSurf
|
|||||||
// Function : Convert_Presentation::drawCurveAndItsBSpline
|
// Function : Convert_Presentation::drawCurveAndItsBSpline
|
||||||
// Purpose :
|
// Purpose :
|
||||||
//================================================================
|
//================================================================
|
||||||
void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
|
void Convert_Presentation::drawCurveAndItsBSpline(Handle_Geom_Curve theCurve,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
TCollection_AsciiString& theText)
|
TCollection_AsciiString& theText)
|
||||||
{
|
{
|
||||||
@@ -127,7 +127,7 @@ void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
|
|||||||
aTitle += " to BSpline curve";
|
aTitle += " to BSpline curve";
|
||||||
|
|
||||||
theText += EOL
|
theText += EOL
|
||||||
" Handle(Geom_BSplineCurve) aBSpline = " EOL
|
" Handle_Geom_BSplineCurve aBSpline = " EOL
|
||||||
" GeomConvert::CurveToBSplineCurve(aCurve);" EOL;
|
" GeomConvert::CurveToBSplineCurve(aCurve);" EOL;
|
||||||
|
|
||||||
setResultTitle (aTitle.ToCString());
|
setResultTitle (aTitle.ToCString());
|
||||||
@@ -137,7 +137,7 @@ void Convert_Presentation::drawCurveAndItsBSpline(Handle(Geom_Curve) theCurve,
|
|||||||
|
|
||||||
if (WAIT_A_LITTLE) return;
|
if (WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_BSplineCurve) aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
|
Handle_Geom_BSplineCurve aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);
|
||||||
|
|
||||||
drawCurve (aBSpline, BSplineColor);
|
drawCurve (aBSpline, BSplineColor);
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ void Convert_Presentation::sampleCircle()
|
|||||||
gp_Dir aDir (1,0,0);
|
gp_Dir aDir (1,0,0);
|
||||||
gp_Ax2 aAxis (aOrigin, aDir);
|
gp_Ax2 aAxis (aOrigin, aDir);
|
||||||
Standard_Real aRadius = 300;
|
Standard_Real aRadius = 300;
|
||||||
Handle(Geom_Circle) aCurve = new Geom_Circle (aAxis, aRadius);
|
Handle_Geom_Circle aCurve = new Geom_Circle (aAxis, aRadius);
|
||||||
|
|
||||||
TCollection_AsciiString aText (
|
TCollection_AsciiString aText (
|
||||||
" gp_Pnt aOrigin (0,0,0);" EOL
|
" gp_Pnt aOrigin (0,0,0);" EOL
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
class Geom_Curve;
|
class Handle_Geom_Curve;
|
||||||
class Geom_Surface;
|
class Handle_Geom_Surface;
|
||||||
|
|
||||||
class Quantity_Color;
|
class Quantity_Color;
|
||||||
|
|
||||||
@@ -38,10 +38,10 @@ private:
|
|||||||
void sampleConicalSurface();
|
void sampleConicalSurface();
|
||||||
void sampleSphericalSurface();
|
void sampleSphericalSurface();
|
||||||
|
|
||||||
void drawCurveAndItsBSpline (Handle(Geom_Curve) theCurve,
|
void drawCurveAndItsBSpline (Handle_Geom_Curve theCurve,
|
||||||
const Standard_CString theName, TCollection_AsciiString& theText);
|
const Standard_CString theName, TCollection_AsciiString& theText);
|
||||||
|
|
||||||
void drawSurfaceAndItsBSpline (Handle(Geom_Surface) theSurface,
|
void drawSurfaceAndItsBSpline (Handle_Geom_Surface theSurface,
|
||||||
const Standard_CString theName, TCollection_AsciiString& theText);
|
const Standard_CString theName, TCollection_AsciiString& theText);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -196,14 +196,14 @@ void DCA_Presentation::sampleParabola()
|
|||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Line) aFocalLenLin = new Geom_Line(gce_MakeLin(aPointParab, gp_Dir(0,0,1)));
|
Handle_Geom_Line aFocalLenLin = new Geom_Line(gce_MakeLin(aPointParab, gp_Dir(0,0,1)));
|
||||||
Handle(Geom_TrimmedCurve) aTrim = new Geom_TrimmedCurve(aFocalLenLin, -aFocalLength/2, aFocalLength/2);
|
Handle_Geom_TrimmedCurve aTrim = new Geom_TrimmedCurve(aFocalLenLin, -aFocalLength/2, aFocalLength/2);
|
||||||
drawCurve(aTrim);
|
drawCurve(aTrim);
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Parabola) aParabola = new Geom_Parabola(aParab);
|
Handle_Geom_Parabola aParabola = new Geom_Parabola(aParab);
|
||||||
Handle(Geom_TrimmedCurve) aParabTrimmed =
|
Handle_Geom_TrimmedCurve aParabTrimmed =
|
||||||
new Geom_TrimmedCurve(aParabola,-300,300,Standard_True);
|
new Geom_TrimmedCurve(aParabola,-300,300,Standard_True);
|
||||||
drawCurve(aParabTrimmed);
|
drawCurve(aParabTrimmed);
|
||||||
|
|
||||||
@@ -218,8 +218,8 @@ void DCA_Presentation::sampleParabola()
|
|||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Parabola) aParabola1 = new Geom_Parabola(aParab1);
|
Handle_Geom_Parabola aParabola1 = new Geom_Parabola(aParab1);
|
||||||
Handle(Geom_TrimmedCurve) aParabTrimmed1 = new Geom_TrimmedCurve(aParabola1,-300,300,Standard_True);
|
Handle_Geom_TrimmedCurve aParabTrimmed1 = new Geom_TrimmedCurve(aParabola1,-300,300,Standard_True);
|
||||||
drawCurve(aParabTrimmed1);
|
drawCurve(aParabTrimmed1);
|
||||||
}
|
}
|
||||||
//================================================================
|
//================================================================
|
||||||
@@ -283,8 +283,8 @@ void DCA_Presentation::sampleHyperbola()
|
|||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Hyperbola) aHyperbola1 = new Geom_Hyperbola(aHypr1);
|
Handle_Geom_Hyperbola aHyperbola1 = new Geom_Hyperbola(aHypr1);
|
||||||
Handle(Geom_TrimmedCurve) aHyprTrimmed =
|
Handle_Geom_TrimmedCurve aHyprTrimmed =
|
||||||
new Geom_TrimmedCurve(aHyperbola1,-3,4,Standard_True);
|
new Geom_TrimmedCurve(aHyperbola1,-3,4,Standard_True);
|
||||||
drawCurve(aHyprTrimmed);
|
drawCurve(aHyprTrimmed);
|
||||||
|
|
||||||
@@ -305,23 +305,23 @@ void DCA_Presentation::sampleHyperbola()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output of display MajorRadius (yellow color)
|
//output of display MajorRadius (yellow color)
|
||||||
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin(aPointHypr1,aPointHypr2));
|
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin(aPointHypr1,aPointHypr2));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed1 =
|
Handle_Geom_TrimmedCurve aTrimmed1 =
|
||||||
new Geom_TrimmedCurve(aLine, 0, aPointHypr1.Distance(aPointHypr2));
|
new Geom_TrimmedCurve(aLine, 0, aPointHypr1.Distance(aPointHypr2));
|
||||||
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_YELLOW));
|
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_YELLOW));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output of display MinorRadius (yellow color)
|
//output of display MinorRadius (yellow color)
|
||||||
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aPointHypr3, gp_Dir(0,-1,0)));
|
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aPointHypr3, gp_Dir(0,-1,0)));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed2 = new Geom_TrimmedCurve(aLine1, 0,100);
|
Handle_Geom_TrimmedCurve aTrimmed2 = new Geom_TrimmedCurve(aLine1, 0,100);
|
||||||
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_YELLOW));
|
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_YELLOW));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output hyperbola
|
//output hyperbola
|
||||||
Handle(Geom_Hyperbola) aHyperbola2 = new Geom_Hyperbola(aHypr2);
|
Handle_Geom_Hyperbola aHyperbola2 = new Geom_Hyperbola(aHypr2);
|
||||||
Handle(Geom_TrimmedCurve) aHyprTrimmed1 =
|
Handle_Geom_TrimmedCurve aHyprTrimmed1 =
|
||||||
new Geom_TrimmedCurve(aHyperbola2,-2,2,Standard_True);
|
new Geom_TrimmedCurve(aHyperbola2,-2,2,Standard_True);
|
||||||
drawCurve(aHyprTrimmed1);
|
drawCurve(aHyprTrimmed1);
|
||||||
}
|
}
|
||||||
@@ -396,8 +396,8 @@ void DCA_Presentation::sampleCircle()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output radius
|
//output radius
|
||||||
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin (aCenterPoint,gp_Dir(0,0,1)));
|
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin (aCenterPoint,gp_Dir(0,0,1)));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,0,300);
|
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,0,300);
|
||||||
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
@@ -519,16 +519,16 @@ void DCA_Presentation::sampleEllipse()
|
|||||||
gp_Lin aLine1 = aMakeLin1.Value();
|
gp_Lin aLine1 = aMakeLin1.Value();
|
||||||
|
|
||||||
//output MajorRadius
|
//output MajorRadius
|
||||||
Handle(Geom_Line) aLineMajorRadius = new Geom_Line(aLine);
|
Handle_Geom_Line aLineMajorRadius = new Geom_Line(aLine);
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed =
|
Handle_Geom_TrimmedCurve aTrimmed =
|
||||||
new Geom_TrimmedCurve(aLineMajorRadius,0,120);
|
new Geom_TrimmedCurve(aLineMajorRadius,0,120);
|
||||||
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output MinorRadius
|
//output MinorRadius
|
||||||
Handle(Geom_Line) aLineMinorrRadius = new Geom_Line(aLine1);
|
Handle_Geom_Line aLineMinorrRadius = new Geom_Line(aLine1);
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed1 =
|
Handle_Geom_TrimmedCurve aTrimmed1 =
|
||||||
new Geom_TrimmedCurve(aLineMinorrRadius,0,300);
|
new Geom_TrimmedCurve(aLineMinorrRadius,0,300);
|
||||||
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
@@ -588,8 +588,8 @@ void DCA_Presentation::samplePlane()
|
|||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Plane) aPln = new Geom_Plane(aPlane);
|
Handle_Geom_Plane aPln = new Geom_Plane(aPlane);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aPlnTrimmed =
|
Handle_Geom_RectangularTrimmedSurface aPlnTrimmed =
|
||||||
new Geom_RectangularTrimmedSurface(aPln,-300,300,-300,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aPln,-300,300,-300,300,Standard_True,Standard_True);
|
||||||
drawSurface(aPlnTrimmed);
|
drawSurface(aPlnTrimmed);
|
||||||
|
|
||||||
@@ -604,8 +604,8 @@ void DCA_Presentation::samplePlane()
|
|||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
Handle(Geom_Plane) aPln1 = new Geom_Plane(aPlane1);
|
Handle_Geom_Plane aPln1 = new Geom_Plane(aPlane1);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aPlnTrimmed1 =
|
Handle_Geom_RectangularTrimmedSurface aPlnTrimmed1 =
|
||||||
new Geom_RectangularTrimmedSurface(aPln1,-200,300,-200,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aPln1,-200,300,-200,300,Standard_True,Standard_True);
|
||||||
drawSurface(aPlnTrimmed1);
|
drawSurface(aPlnTrimmed1);
|
||||||
|
|
||||||
@@ -693,14 +693,14 @@ void DCA_Presentation::sampleCylindricalSurface()
|
|||||||
gp_Dir aDir1(0,0,1);
|
gp_Dir aDir1(0,0,1);
|
||||||
gce_MakeLin aMakeLin(aCenterPoint,aDir1);
|
gce_MakeLin aMakeLin(aCenterPoint,aDir1);
|
||||||
gp_Lin aLin = aMakeLin.Value();
|
gp_Lin aLin = aMakeLin.Value();
|
||||||
Handle(Geom_Line) aLine = new Geom_Line(aLin);
|
Handle_Geom_Line aLine = new Geom_Line(aLin);
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,-100,0);
|
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,-100,0);
|
||||||
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
// output cylinder
|
// output cylinder
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface =
|
Handle_Geom_CylindricalSurface aCylSurface =
|
||||||
new Geom_CylindricalSurface(aCyl);
|
new Geom_CylindricalSurface(aCyl);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
|
||||||
drawSurface(aCylTrimmed);
|
drawSurface(aCylTrimmed);
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
@@ -716,14 +716,14 @@ void DCA_Presentation::sampleCylindricalSurface()
|
|||||||
drawVector(aCylinderPoint2,gp_Vec(aCylinderPoint2,aCylinderPoint3)*3,Quantity_Color(Quantity_NOC_WHITE));
|
drawVector(aCylinderPoint2,gp_Vec(aCylinderPoint2,aCylinderPoint3)*3,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
//output radius
|
//output radius
|
||||||
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aCylinderPoint1,aDir1));
|
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aCylinderPoint1,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed1 = new Geom_TrimmedCurve(aLine1,-80,0);
|
Handle_Geom_TrimmedCurve aTrimmed1 = new Geom_TrimmedCurve(aLine1,-80,0);
|
||||||
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
//output cylinder
|
//output cylinder
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface1 =
|
Handle_Geom_CylindricalSurface aCylSurface1 =
|
||||||
new Geom_CylindricalSurface(aCyl1);
|
new Geom_CylindricalSurface(aCyl1);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed1 =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed1 =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface1,0,2*PI,-300,100,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface1,0,2*PI,-300,100,Standard_True,Standard_True);
|
||||||
drawSurface(aCylTrimmed1);
|
drawSurface(aCylTrimmed1);
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
@@ -731,17 +731,17 @@ void DCA_Presentation::sampleCylindricalSurface()
|
|||||||
|
|
||||||
//METHOD 3.(output of dispay)
|
//METHOD 3.(output of dispay)
|
||||||
//output base cylinder
|
//output base cylinder
|
||||||
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aCylinder);
|
Handle_Geom_CylindricalSurface aCylSurf = new Geom_CylindricalSurface(aCylinder);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed2 =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed2 =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurf,0,2*PI,-200,200,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurf,0,2*PI,-200,200,Standard_True,Standard_True);
|
||||||
drawSurface(aCylTrimmed2 ,Quantity_Color(Quantity_NOC_WHITE));
|
drawSurface(aCylTrimmed2 ,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
//output point
|
//output point
|
||||||
drawPoint(aCylinderPoint4);
|
drawPoint(aCylinderPoint4);
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
//output cylinder
|
//output cylinder
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface2 =
|
Handle_Geom_CylindricalSurface aCylSurface2 =
|
||||||
new Geom_CylindricalSurface(aCyl2);
|
new Geom_CylindricalSurface(aCyl2);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed3 =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed3 =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface2,0,2*PI,-200,200,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface2,0,2*PI,-200,200,Standard_True,Standard_True);
|
||||||
drawSurface(aCylTrimmed3);
|
drawSurface(aCylTrimmed3);
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
@@ -753,9 +753,9 @@ void DCA_Presentation::sampleCylindricalSurface()
|
|||||||
drawCurve(new Geom_Circle(aCirc),Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(new Geom_Circle(aCirc),Quantity_Color(Quantity_NOC_WHITE));
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
//output cylinder
|
//output cylinder
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface3 =
|
Handle_Geom_CylindricalSurface aCylSurface3 =
|
||||||
new Geom_CylindricalSurface(aCyl3);
|
new Geom_CylindricalSurface(aCyl3);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed4 =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed4 =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface3,0,2*PI,-200,200,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface3,0,2*PI,-200,200,Standard_True,Standard_True);
|
||||||
drawSurface(aCylTrimmed4);
|
drawSurface(aCylTrimmed4);
|
||||||
}
|
}
|
||||||
@@ -800,8 +800,8 @@ void DCA_Presentation::sampleToroidalSurface()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output MajorRadius
|
//output MajorRadius
|
||||||
Handle(Geom_Line) R1 = new Geom_Line(gce_MakeLin(aCenterPoint, gp_Dir(0,1,0)));
|
Handle_Geom_Line R1 = new Geom_Line(gce_MakeLin(aCenterPoint, gp_Dir(0,1,0)));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmedR1 = new Geom_TrimmedCurve(R1,0,MajorRadius);
|
Handle_Geom_TrimmedCurve aTrimmedR1 = new Geom_TrimmedCurve(R1,0,MajorRadius);
|
||||||
drawCurve(aTrimmedR1, Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmedR1, Quantity_Color(Quantity_NOC_WHITE));
|
||||||
drawCurve(new Geom_Circle(anAx3.Ax2(), MajorRadius));
|
drawCurve(new Geom_Circle(anAx3.Ax2(), MajorRadius));
|
||||||
|
|
||||||
@@ -809,7 +809,7 @@ void DCA_Presentation::sampleToroidalSurface()
|
|||||||
|
|
||||||
// output MinorRadius as a circle
|
// output MinorRadius as a circle
|
||||||
gp_Ax2 aMinorRadAx(aTrimmedR1->EndPoint(), gp_Dir(0,0,1));
|
gp_Ax2 aMinorRadAx(aTrimmedR1->EndPoint(), gp_Dir(0,0,1));
|
||||||
Handle(Geom_Circle) aMinorRadCirc = new Geom_Circle(aMinorRadAx, MinorRadius);
|
Handle_Geom_Circle aMinorRadCirc = new Geom_Circle(aMinorRadAx, MinorRadius);
|
||||||
drawCurve(aMinorRadCirc);
|
drawCurve(aMinorRadCirc);
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
@@ -915,28 +915,28 @@ void DCA_Presentation::sampleConicalSurface()
|
|||||||
|
|
||||||
gp_Dir aDir1(0,1,0);
|
gp_Dir aDir1(0,1,0);
|
||||||
//output first radius
|
//output first radius
|
||||||
Handle(Geom_Line) aLine = new Geom_Line(gce_MakeLin(aConePnt,aDir1));
|
Handle_Geom_Line aLine = new Geom_Line(gce_MakeLin(aConePnt,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed = new Geom_TrimmedCurve(aLine,0,100);
|
Handle_Geom_TrimmedCurve aTrimmed = new Geom_TrimmedCurve(aLine,0,100);
|
||||||
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
//output second radius
|
//output second radius
|
||||||
Handle(Geom_Line) aLine1 = new Geom_Line(gce_MakeLin(aConePnt1,aDir1));
|
Handle_Geom_Line aLine1 = new Geom_Line(gce_MakeLin(aConePnt1,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed1 = new Geom_TrimmedCurve(aLine1,0,50);
|
Handle_Geom_TrimmedCurve aTrimmed1 = new Geom_TrimmedCurve(aLine1,0,50);
|
||||||
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed1,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output ruling of cone
|
//output ruling of cone
|
||||||
Handle(Geom_Line) aLine2 = new Geom_Line(gce_MakeLin(aConePnt,aConePnt1));
|
Handle_Geom_Line aLine2 = new Geom_Line(gce_MakeLin(aConePnt,aConePnt1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed2 =
|
Handle_Geom_TrimmedCurve aTrimmed2 =
|
||||||
new Geom_TrimmedCurve(aLine2,0,aConePnt.Distance(aConePnt1));
|
new Geom_TrimmedCurve(aLine2,0,aConePnt.Distance(aConePnt1));
|
||||||
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_RED));
|
drawCurve(aTrimmed2,Quantity_Color(Quantity_NOC_RED));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output cone
|
//output cone
|
||||||
Handle(Geom_ConicalSurface) aConSurface1 = new Geom_ConicalSurface(aCone1);
|
Handle_Geom_ConicalSurface aConSurface1 = new Geom_ConicalSurface(aCone1);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aConTrimmed1 =
|
Handle_Geom_RectangularTrimmedSurface aConTrimmed1 =
|
||||||
new Geom_RectangularTrimmedSurface(aConSurface1,0,2*PI,-50,450,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aConSurface1,0,2*PI,-50,450,Standard_True,Standard_True);
|
||||||
drawSurface(aConTrimmed1);
|
drawSurface(aConTrimmed1);
|
||||||
|
|
||||||
@@ -955,18 +955,18 @@ void DCA_Presentation::sampleConicalSurface()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output of first radius
|
//output of first radius
|
||||||
Handle(Geom_Line) aLineR1 = new Geom_Line(gce_MakeLin (aConePnt,aDir1));
|
Handle_Geom_Line aLineR1 = new Geom_Line(gce_MakeLin (aConePnt,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmedR1 = new Geom_TrimmedCurve(aLineR1,0,Radius1);
|
Handle_Geom_TrimmedCurve aTrimmedR1 = new Geom_TrimmedCurve(aLineR1,0,Radius1);
|
||||||
drawCurve(aTrimmedR1,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmedR1,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
//output of second radius
|
//output of second radius
|
||||||
Handle(Geom_Line) aLineR2 = new Geom_Line(gce_MakeLin (aConePnt2,aDir1));
|
Handle_Geom_Line aLineR2 = new Geom_Line(gce_MakeLin (aConePnt2,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmedR2 = new Geom_TrimmedCurve(aLineR2,0,Radius2);
|
Handle_Geom_TrimmedCurve aTrimmedR2 = new Geom_TrimmedCurve(aLineR2,0,Radius2);
|
||||||
drawCurve(aTrimmedR2,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmedR2,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
//output cone
|
//output cone
|
||||||
Handle(Geom_ConicalSurface) aConSurface2 = new Geom_ConicalSurface(aCone2);
|
Handle_Geom_ConicalSurface aConSurface2 = new Geom_ConicalSurface(aCone2);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aConTrimmed2 =
|
Handle_Geom_RectangularTrimmedSurface aConTrimmed2 =
|
||||||
new Geom_RectangularTrimmedSurface(aConSurface2,0,2*PI,-120,400,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aConSurface2,0,2*PI,-120,400,Standard_True,Standard_True);
|
||||||
drawSurface(aConTrimmed2);
|
drawSurface(aConTrimmed2);
|
||||||
|
|
||||||
@@ -981,13 +981,13 @@ void DCA_Presentation::sampleConicalSurface()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output radius
|
//output radius
|
||||||
Handle(Geom_Line) aLine3 = new Geom_Line(gce_MakeLin (aCenterPoint,aDir1));
|
Handle_Geom_Line aLine3 = new Geom_Line(gce_MakeLin (aCenterPoint,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed3 = new Geom_TrimmedCurve(aLine3,0,70);
|
Handle_Geom_TrimmedCurve aTrimmed3 = new Geom_TrimmedCurve(aLine3,0,70);
|
||||||
drawCurve(aTrimmed3 ,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed3 ,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
//output cone
|
//output cone
|
||||||
Handle(Geom_ConicalSurface) aConSurface3 = new Geom_ConicalSurface(aCone3);
|
Handle_Geom_ConicalSurface aConSurface3 = new Geom_ConicalSurface(aCone3);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aConTrimmed =
|
Handle_Geom_RectangularTrimmedSurface aConTrimmed =
|
||||||
new Geom_RectangularTrimmedSurface(aConSurface3,0,2*PI,-300,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aConSurface3,0,2*PI,-300,300,Standard_True,Standard_True);
|
||||||
drawSurface(aConTrimmed);
|
drawSurface(aConTrimmed);
|
||||||
|
|
||||||
@@ -1011,30 +1011,30 @@ void DCA_Presentation::sampleConicalSurface()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output ruling of cone
|
//output ruling of cone
|
||||||
Handle(Geom_Line) aLine4 = new Geom_Line(gce_MakeLin (aPoint_3,aPoint_4));
|
Handle_Geom_Line aLine4 = new Geom_Line(gce_MakeLin (aPoint_3,aPoint_4));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed4 =
|
Handle_Geom_TrimmedCurve aTrimmed4 =
|
||||||
new Geom_TrimmedCurve(aLine4,0,aPoint_3.Distance(aPoint_4));
|
new Geom_TrimmedCurve(aLine4,0,aPoint_3.Distance(aPoint_4));
|
||||||
drawCurve(aTrimmed4 ,Quantity_Color(Quantity_NOC_RED));
|
drawCurve(aTrimmed4 ,Quantity_Color(Quantity_NOC_RED));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output first radius
|
//output first radius
|
||||||
Handle(Geom_Line) aLine5 = new Geom_Line(gce_MakeLin (aPoint_3,aDir1));
|
Handle_Geom_Line aLine5 = new Geom_Line(gce_MakeLin (aPoint_3,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed5 = new Geom_TrimmedCurve(aLine5,0,50);
|
Handle_Geom_TrimmedCurve aTrimmed5 = new Geom_TrimmedCurve(aLine5,0,50);
|
||||||
drawCurve(aTrimmed5 ,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed5 ,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output second radius
|
//output second radius
|
||||||
Handle(Geom_Line) aLine6 = new Geom_Line(gce_MakeLin (aPoint_4,aDir1));
|
Handle_Geom_Line aLine6 = new Geom_Line(gce_MakeLin (aPoint_4,aDir1));
|
||||||
Handle(Geom_TrimmedCurve) aTrimmed6 = new Geom_TrimmedCurve(aLine6,0,60);
|
Handle_Geom_TrimmedCurve aTrimmed6 = new Geom_TrimmedCurve(aLine6,0,60);
|
||||||
drawCurve(aTrimmed6 ,Quantity_Color(Quantity_NOC_WHITE));
|
drawCurve(aTrimmed6 ,Quantity_Color(Quantity_NOC_WHITE));
|
||||||
|
|
||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
//output cone
|
//output cone
|
||||||
Handle(Geom_ConicalSurface) aConSurface4 = new Geom_ConicalSurface(aCone4);
|
Handle_Geom_ConicalSurface aConSurface4 = new Geom_ConicalSurface(aCone4);
|
||||||
Handle(Geom_RectangularTrimmedSurface) aConTrimmed4 =
|
Handle_Geom_RectangularTrimmedSurface aConTrimmed4 =
|
||||||
new Geom_RectangularTrimmedSurface(aConSurface4,0,2*PI,-300,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aConSurface4,0,2*PI,-300,300,Standard_True,Standard_True);
|
||||||
drawSurface(aConTrimmed4);
|
drawSurface(aConTrimmed4);
|
||||||
|
|
||||||
|
@@ -199,7 +199,7 @@ void Extrema_Presentation::sampleCurveSur()
|
|||||||
TCollection_AsciiString aText(
|
TCollection_AsciiString aText(
|
||||||
" // the curve - first object for finding the extrema." EOL
|
" // the curve - first object for finding the extrema." EOL
|
||||||
" Handle(Geom_Curve) aCurve;" EOL
|
" Handle(Geom_Curve) aCurve;" EOL
|
||||||
" Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);" EOL EOL
|
" Handle_TColgp_HArray1OfPnt aPoles = new TColgp_HArray1OfPnt(1, 4);" EOL EOL
|
||||||
|
|
||||||
" // points to build the curves" EOL
|
" // points to build the curves" EOL
|
||||||
" Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}}; " EOL EOL
|
" Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}}; " EOL EOL
|
||||||
@@ -239,7 +239,7 @@ void Extrema_Presentation::sampleCurveSur()
|
|||||||
|
|
||||||
// the curve - first object for finding the extrema.
|
// the curve - first object for finding the extrema.
|
||||||
Handle(Geom_Curve) aCurve;
|
Handle(Geom_Curve) aCurve;
|
||||||
Handle(TColgp_HArray1OfPnt) aPoles = new TColgp_HArray1OfPnt(1, 4);
|
Handle_TColgp_HArray1OfPnt aPoles = new TColgp_HArray1OfPnt(1, 4);
|
||||||
|
|
||||||
// points to build the curves
|
// points to build the curves
|
||||||
Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}};
|
Standard_Real a[][3] = {{2,1,10},{0,12,0},{5,6,0},{0,10,11}};
|
||||||
@@ -429,7 +429,7 @@ void Extrema_Presentation::sampleShellShell()
|
|||||||
" for (Standard_Integer j=0; j < 3; j++)" EOL
|
" for (Standard_Integer j=0; j < 3; j++)" EOL
|
||||||
" aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);" EOL EOL
|
" aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);" EOL EOL
|
||||||
|
|
||||||
" Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);" EOL EOL
|
" Handle_Geom_BezierSurface aSurface = new Geom_BezierSurface(aSurPoles);" EOL EOL
|
||||||
|
|
||||||
" // creating a TopoDS_Shell from Geom_Surface" EOL
|
" // creating a TopoDS_Shell from Geom_Surface" EOL
|
||||||
" TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);" EOL EOL
|
" TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);" EOL EOL
|
||||||
@@ -473,7 +473,7 @@ void Extrema_Presentation::sampleShellShell()
|
|||||||
for (Standard_Integer j=0; j < 3; j++)
|
for (Standard_Integer j=0; j < 3; j++)
|
||||||
aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);
|
aSurPoles(i+1,j+1) = gp_Pnt (aSurCoords[i*3+j][0]*10-250, aSurCoords[i*3+j][1]*10-250, aSurCoords[i*3+j][2]*10-350);
|
||||||
|
|
||||||
Handle(Geom_BezierSurface) aSurface = new Geom_BezierSurface(aSurPoles);
|
Handle_Geom_BezierSurface aSurface = new Geom_BezierSurface(aSurPoles);
|
||||||
|
|
||||||
// creating a TopoDS_Shell from Geom_Surface
|
// creating a TopoDS_Shell from Geom_Surface
|
||||||
TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);
|
TopoDS_Shell aShape2 = BRepBuilderAPI_MakeShell(aSurface);
|
||||||
@@ -535,10 +535,10 @@ void Extrema_Presentation::doShapeShapeExtrema(const TopoDS_Shape& theShape1,
|
|||||||
{
|
{
|
||||||
displayExtemaEdge(anExtrema.PointOnShape1(i), anExtrema.PointOnShape2(i));
|
displayExtemaEdge(anExtrema.PointOnShape1(i), anExtrema.PointOnShape2(i));
|
||||||
|
|
||||||
Handle(AIS_Shape) aSupportShape1 = new AIS_Shape(anExtrema.SupportOnShape1(i));
|
Handle_AIS_Shape aSupportShape1 = new AIS_Shape(anExtrema.SupportOnShape1(i));
|
||||||
aSupportShape1->SetMaterial(Graphic3d_NOM_PLASTIC);
|
aSupportShape1->SetMaterial(Graphic3d_NOM_PLASTIC);
|
||||||
aSupportShape1->SetColor(Quantity_NOC_GRAY97);
|
aSupportShape1->SetColor(Quantity_NOC_GRAY97);
|
||||||
Handle(AIS_Shape) aSupportShape2 = new AIS_Shape(anExtrema.SupportOnShape2(i));
|
Handle_AIS_Shape aSupportShape2 = new AIS_Shape(anExtrema.SupportOnShape2(i));
|
||||||
aSupportShape2->SetMaterial(Graphic3d_NOM_PLASTIC);
|
aSupportShape2->SetMaterial(Graphic3d_NOM_PLASTIC);
|
||||||
aSupportShape2->SetColor(Quantity_NOC_GRAY97);
|
aSupportShape2->SetColor(Quantity_NOC_GRAY97);
|
||||||
getAISContext()->Display(aSupportShape1, Standard_False);
|
getAISContext()->Display(aSupportShape1, Standard_False);
|
||||||
|
@@ -241,7 +241,7 @@ Standard_Boolean GProps_Presentation::GProps(GProp_GProps& aProps,
|
|||||||
|
|
||||||
if (WAIT_A_SECOND) return Standard_False;
|
if (WAIT_A_SECOND) return Standard_False;
|
||||||
|
|
||||||
Handle(AIS_Point) aPointIO = drawPoint(
|
Handle_AIS_Point aPointIO = drawPoint(
|
||||||
aCenterOfMass, MAIN_ELEMS_COLOR, Standard_False);
|
aCenterOfMass, MAIN_ELEMS_COLOR, Standard_False);
|
||||||
aPointIO->UnsetMarker();
|
aPointIO->UnsetMarker();
|
||||||
aPointIO->SetMarker(Aspect_TOM_O);
|
aPointIO->SetMarker(Aspect_TOM_O);
|
||||||
@@ -265,7 +265,7 @@ Standard_Boolean GProps_Presentation::GProps(GProp_GProps& aProps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// display the cirle with radius = aRadiusOfGyration
|
// display the cirle with radius = aRadiusOfGyration
|
||||||
Handle(Geom_Circle) aCirc = new Geom_Circle(anInertialCoordSys, aRadiusOfGyration);
|
Handle_Geom_Circle aCirc = new Geom_Circle(anInertialCoordSys, aRadiusOfGyration);
|
||||||
drawCurve(aCirc, CUSTOM_INERTIAL_ELEMS_COLOR);
|
drawCurve(aCirc, CUSTOM_INERTIAL_ELEMS_COLOR);
|
||||||
|
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
@@ -327,7 +327,7 @@ void GProps_Presentation::samplePoints()
|
|||||||
|
|
||||||
//if (WAIT_A_SECOND) return;
|
//if (WAIT_A_SECOND) return;
|
||||||
|
|
||||||
Handle(AIS_Point) aPointIO = drawPoint(
|
Handle_AIS_Point aPointIO = drawPoint(
|
||||||
aBaryCentre, MAIN_ELEMS_COLOR, Standard_False);
|
aBaryCentre, MAIN_ELEMS_COLOR, Standard_False);
|
||||||
aPointIO->SetMarker(Aspect_TOM_STAR);
|
aPointIO->SetMarker(Aspect_TOM_STAR);
|
||||||
getAISContext()->Display(aPointIO);
|
getAISContext()->Display(aPointIO);
|
||||||
@@ -373,7 +373,7 @@ void GProps_Presentation::sampleCurves()
|
|||||||
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
|
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
|
||||||
|
|
||||||
// edge 2 is a bezier curve that starts in edge1's end point
|
// edge 2 is a bezier curve that starts in edge1's end point
|
||||||
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
|
Handle_Geom_BezierCurve aCurve = new Geom_BezierCurve(aPoints);
|
||||||
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aCurve);
|
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aCurve);
|
||||||
|
|
||||||
// edge 1 is a linear edge between 2 points
|
// edge 1 is a linear edge between 2 points
|
||||||
@@ -575,9 +575,9 @@ void GProps_Presentation::sampleSystem()
|
|||||||
for (Standard_Integer i=0; i < nPoints; i++)
|
for (Standard_Integer i=0; i < nPoints; i++)
|
||||||
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
|
aPoints(i+1) = gp_Pnt (aCoords[i][0]*k, aCoords[i][1]*k, aCoords[i][2]*k);
|
||||||
|
|
||||||
Handle(Geom_BezierCurve) aCurve = new Geom_BezierCurve(aPoints);
|
Handle_Geom_BezierCurve aCurve = new Geom_BezierCurve(aPoints);
|
||||||
gp_Ax1 anAxis(aPoints(1), gp_Dir(0,1,0));
|
gp_Ax1 anAxis(aPoints(1), gp_Dir(0,1,0));
|
||||||
Handle(Geom_SurfaceOfRevolution) aSurface = new Geom_SurfaceOfRevolution(aCurve, anAxis);
|
Handle_Geom_SurfaceOfRevolution aSurface = new Geom_SurfaceOfRevolution(aCurve, anAxis);
|
||||||
TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(BRepBuilderAPI_MakeShell(aSurface));
|
TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(BRepBuilderAPI_MakeShell(aSurface));
|
||||||
|
|
||||||
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(gp_Pnt(5*k, 2*k, 0), gp_Pnt(12*k, 7*k, 0));
|
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(gp_Pnt(5*k, 2*k, 0), gp_Pnt(12*k, 7*k, 0));
|
||||||
@@ -595,8 +595,8 @@ void GProps_Presentation::sampleSystem()
|
|||||||
aBuilder.Perform(aWing1, Standard_True);
|
aBuilder.Perform(aWing1, Standard_True);
|
||||||
TopoDS_Face aWing2 = TopoDS::Face(aBuilder.Shape());
|
TopoDS_Face aWing2 = TopoDS::Face(aBuilder.Shape());
|
||||||
|
|
||||||
Handle(Geom_Circle) aCirc = new Geom_Circle(gp_Ax2(gp_Pnt(3*k, 11*k, 0), gp_Dir(0,-0.2,0.8)), (12-3)*k);
|
Handle_Geom_Circle aCirc = new Geom_Circle(gp_Ax2(gp_Pnt(3*k, 11*k, 0), gp_Dir(0,-0.2,0.8)), (12-3)*k);
|
||||||
Handle(Geom_TrimmedCurve) aTrimCirc = new Geom_TrimmedCurve(aCirc, -PI/2, PI/2);
|
Handle_Geom_TrimmedCurve aTrimCirc = new Geom_TrimmedCurve(aCirc, -PI/2, PI/2);
|
||||||
TopoDS_Edge aSpoiler = BRepBuilderAPI_MakeEdge(aTrimCirc);
|
TopoDS_Edge aSpoiler = BRepBuilderAPI_MakeEdge(aTrimCirc);
|
||||||
|
|
||||||
TopoDS_Edge anArrow = BRepBuilderAPI_MakeEdge(gp_Pnt(3*k, 0, 0), gp_Pnt(3*k, -5*k, 0));
|
TopoDS_Edge anArrow = BRepBuilderAPI_MakeEdge(gp_Pnt(3*k, 0, 0), gp_Pnt(3*k, -5*k, 0));
|
||||||
|
@@ -95,7 +95,7 @@ void GeomConstraints_Presentation::DoSample()
|
|||||||
// Function creating Surface,BSPline,Bezier and 2dBSpline Curves
|
// Function creating Surface,BSPline,Bezier and 2dBSpline Curves
|
||||||
//=========================================================================================
|
//=========================================================================================
|
||||||
|
|
||||||
static Handle(Geom_BSplineCurve) createBSplineCurve(const Standard_Integer nPoles,
|
static Handle_Geom_BSplineCurve createBSplineCurve(const Standard_Integer nPoles,
|
||||||
const Standard_Real theCoords[][3])
|
const Standard_Real theCoords[][3])
|
||||||
{
|
{
|
||||||
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
||||||
@@ -111,7 +111,7 @@ static Handle(Geom_BSplineCurve) createBSplineCurve(const Standard_Integer nPole
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Handle(Geom_BezierCurve) createBezierCurve(const Standard_Integer nPoles,
|
static Handle_Geom_BezierCurve createBezierCurve(const Standard_Integer nPoles,
|
||||||
const Standard_Real theCoords[][3])
|
const Standard_Real theCoords[][3])
|
||||||
{
|
{
|
||||||
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
||||||
@@ -123,7 +123,7 @@ static Handle(Geom_BezierCurve) createBezierCurve(const Standard_Integer nPoles,
|
|||||||
return aBCurve;
|
return aBCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom2d_BSplineCurve) battenCurve(const Standard_Real& theAngle1,
|
static Handle_Geom2d_BSplineCurve battenCurve(const Standard_Real& theAngle1,
|
||||||
const Standard_Real& theAngle2)
|
const Standard_Real& theAngle2)
|
||||||
{
|
{
|
||||||
//define points
|
//define points
|
||||||
@@ -149,10 +149,10 @@ static Handle(Geom2d_BSplineCurve) battenCurve(const Standard_Real& theAngle1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Handle(Geom_Surface) createSurface(
|
static Handle_Geom_Surface createSurface(
|
||||||
const Standard_Integer endBound,
|
const Standard_Integer endBound,
|
||||||
TColgp_Array1OfPnt& thePoint,
|
TColgp_Array1OfPnt& thePoint,
|
||||||
const Handle(Geom_Plane)& thePlane)
|
const Handle_Geom_Plane& thePlane)
|
||||||
{
|
{
|
||||||
Standard_Integer Degree = 3;
|
Standard_Integer Degree = 3;
|
||||||
Standard_Integer NbPtsOnCur = 10;
|
Standard_Integer NbPtsOnCur = 10;
|
||||||
@@ -630,7 +630,7 @@ void GeomConstraints_Presentation::sample3()
|
|||||||
}
|
}
|
||||||
aFile.close();
|
aFile.close();
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) anIO,aNewIO;
|
Handle_AIS_InteractiveObject anIO,aNewIO;
|
||||||
|
|
||||||
for(Standard_Integer j = 1; j <= int(aSize / 20); j++)
|
for(Standard_Integer j = 1; j <= int(aSize / 20); j++)
|
||||||
{
|
{
|
||||||
|
@@ -168,9 +168,9 @@ void Glue_Presentation::sampleCylinder()
|
|||||||
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,0,0),gp_Pnt(24,15,0));
|
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,0,0),gp_Pnt(24,15,0));
|
||||||
TopoDS_Edge e5 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,15,0),gp_Pnt(0,15,0));
|
TopoDS_Edge e5 = BRepBuilderAPI_MakeEdge(gp_Pnt(24,15,0),gp_Pnt(0,15,0));
|
||||||
TopoDS_Edge e6 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,15,0),gp_Pnt(0,0,0));
|
TopoDS_Edge e6 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,15,0),gp_Pnt(0,0,0));
|
||||||
Handle(Geom_Circle) e2C = new Geom_Circle(gp_Ax2(gp_Pnt(12,0,0), gp_Dir(0,0,1)), 7);
|
Handle_Geom_Circle e2C = new Geom_Circle(gp_Ax2(gp_Pnt(12,0,0), gp_Dir(0,0,1)), 7);
|
||||||
e2C->Rotate(gp_Ax1(gp_Pnt(12,0,0),gp_Dir(0,0,1)),PI);
|
e2C->Rotate(gp_Ax1(gp_Pnt(12,0,0),gp_Dir(0,0,1)),PI);
|
||||||
Handle(Geom_TrimmedCurve) e2A = new Geom_TrimmedCurve(e2C, PI, 2*PI);
|
Handle_Geom_TrimmedCurve e2A = new Geom_TrimmedCurve(e2C, PI, 2*PI);
|
||||||
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(e2A);
|
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(e2A);
|
||||||
|
|
||||||
BRepBuilderAPI_MakeWire wireMaker(e1,e2,e3,e4);
|
BRepBuilderAPI_MakeWire wireMaker(e1,e2,e3,e4);
|
||||||
@@ -311,7 +311,7 @@ void Glue_Presentation::sampleMoreBoxes()
|
|||||||
// Purpose : display a shape in wire frame mode
|
// Purpose : display a shape in wire frame mode
|
||||||
//================================================================
|
//================================================================
|
||||||
Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
|
Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
|
||||||
Handle(AIS_InteractiveObject)& io)
|
Handle_AIS_InteractiveObject& io)
|
||||||
{
|
{
|
||||||
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
||||||
getAISContext()->SetDisplayMode(io, AIS_WireFrame, Standard_False);
|
getAISContext()->SetDisplayMode(io, AIS_WireFrame, Standard_False);
|
||||||
@@ -325,7 +325,7 @@ Standard_Boolean Glue_Presentation::drawShapeWf(TopoDS_Shape& aShape,
|
|||||||
// Purpose : display a shape in shaded mode
|
// Purpose : display a shape in shaded mode
|
||||||
//================================================================
|
//================================================================
|
||||||
Standard_Boolean Glue_Presentation::drawShapeSh(TopoDS_Shape& aShape,
|
Standard_Boolean Glue_Presentation::drawShapeSh(TopoDS_Shape& aShape,
|
||||||
Handle(AIS_InteractiveObject)& io)
|
Handle_AIS_InteractiveObject& io)
|
||||||
{
|
{
|
||||||
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
io = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
||||||
getAISContext()->SetDisplayMode(io, AIS_Shaded, Standard_False);
|
getAISContext()->SetDisplayMode(io, AIS_Shaded, Standard_False);
|
||||||
@@ -346,7 +346,7 @@ Standard_Boolean Glue_Presentation::displayShapesFaces(TopoDS_Shape& aShape1,
|
|||||||
TopTools_ListOfShape& aEdges1,
|
TopTools_ListOfShape& aEdges1,
|
||||||
TopTools_ListOfShape& aEdges2)
|
TopTools_ListOfShape& aEdges2)
|
||||||
{
|
{
|
||||||
Handle(AIS_Shape) io1,io2,io3,io4,io5,io6;
|
Handle_AIS_Shape io1,io2,io3,io4,io5,io6;
|
||||||
if (!drawShapeSh(aShape1, io1)) return Standard_False;
|
if (!drawShapeSh(aShape1, io1)) return Standard_False;
|
||||||
if (!drawShapeSh(aShape2, io2)) return Standard_False;
|
if (!drawShapeSh(aShape2, io2)) return Standard_False;
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
class GProp_Glue;
|
class GProp_Glue;
|
||||||
class TCollection_AsciiString;
|
class TCollection_AsciiString;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class AIS_InteractiveObject;
|
class Handle_AIS_InteractiveObject;
|
||||||
#include <TopTools_ListOfShape.hxx>
|
class TopTools_ListOfShape;
|
||||||
|
|
||||||
class Glue_Presentation : public OCCDemo_Presentation
|
class Glue_Presentation : public OCCDemo_Presentation
|
||||||
{
|
{
|
||||||
@@ -37,10 +37,10 @@ private:
|
|||||||
TopTools_ListOfShape&, TopTools_ListOfShape&);
|
TopTools_ListOfShape&, TopTools_ListOfShape&);
|
||||||
|
|
||||||
// display a given shape in wire frame mode
|
// display a given shape in wire frame mode
|
||||||
Standard_Boolean drawShapeWf(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
|
Standard_Boolean drawShapeWf(TopoDS_Shape&,Handle_AIS_InteractiveObject&);
|
||||||
|
|
||||||
// display a given shape in shaded mode
|
// display a given shape in shaded mode
|
||||||
Standard_Boolean drawShapeSh(TopoDS_Shape&,Handle(AIS_InteractiveObject)&);
|
Standard_Boolean drawShapeSh(TopoDS_Shape&,Handle_AIS_InteractiveObject&);
|
||||||
|
|
||||||
void sampleBoxes();
|
void sampleBoxes();
|
||||||
void sampleCylinder();
|
void sampleCylinder();
|
||||||
|
@@ -78,11 +78,11 @@ void HLR_Presentation::DoSample()
|
|||||||
// Purpose : returns Prs3d_Projector object created corresponding
|
// Purpose : returns Prs3d_Projector object created corresponding
|
||||||
// to the current view parameters
|
// to the current view parameters
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(Prs3d_Projector) HLR_Presentation::Projector(gp_Trsf& theTrsf)
|
Handle_Prs3d_Projector HLR_Presentation::Projector(gp_Trsf& theTrsf)
|
||||||
{
|
{
|
||||||
// retrieve view parameters for creation of Prs3d_Projector object
|
// retrieve view parameters for creation of Prs3d_Projector object
|
||||||
getViewer()->InitActiveViews();
|
getViewer()->InitActiveViews();
|
||||||
Handle(V3d_View) aView = getViewer()->ActiveView();
|
Handle_V3d_View aView = getViewer()->ActiveView();
|
||||||
|
|
||||||
Standard_Real aProjVecX, aProjVecY, aProjVecZ;
|
Standard_Real aProjVecX, aProjVecY, aProjVecZ;
|
||||||
aView->Proj(aProjVecX, aProjVecY, aProjVecZ);
|
aView->Proj(aProjVecX, aProjVecY, aProjVecZ);
|
||||||
@@ -93,7 +93,7 @@ Handle(Prs3d_Projector) HLR_Presentation::Projector(gp_Trsf& theTrsf)
|
|||||||
Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;
|
Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;
|
||||||
|
|
||||||
// create a projector object
|
// create a projector object
|
||||||
Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0,
|
Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0,
|
||||||
aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);
|
aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);
|
||||||
|
|
||||||
gp_Pnt At (aPntX,aPntY,aPntZ);
|
gp_Pnt At (aPntX,aPntY,aPntZ);
|
||||||
@@ -122,14 +122,14 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
|
|||||||
" // initializing aShape ..." EOL
|
" // initializing aShape ..." EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // Build The algorithm object" EOL
|
" // Build The algorithm object" EOL
|
||||||
" Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();" EOL
|
" Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();" EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" // Add Shapes into the algorithm" EOL
|
" // Add Shapes into the algorithm" EOL
|
||||||
" Standard_Real nbIso = 5; // number of isolines to display" EOL
|
" Standard_Real nbIso = 5; // number of isolines to display" EOL
|
||||||
" myAlgo->Add(aShape, nbIso);" EOL
|
" myAlgo->Add(aShape, nbIso);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a projector object" EOL
|
" // create a projector object" EOL
|
||||||
" Handle(V3d_View) aView;" EOL
|
" Handle_V3d_View aView;" EOL
|
||||||
" // initializing V3d_View ..." EOL
|
" // initializing V3d_View ..." EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
|
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
|
||||||
@@ -141,7 +141,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
|
|||||||
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
|
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a projector object" EOL
|
" // create a projector object" EOL
|
||||||
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
|
" Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
|
||||||
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
|
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" // Set The Projector" EOL
|
" // Set The Projector" EOL
|
||||||
@@ -189,7 +189,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
|
|||||||
" Isolines - YELLOW" EOL);
|
" Isolines - YELLOW" EOL);
|
||||||
|
|
||||||
// Build The algorithm object
|
// Build The algorithm object
|
||||||
Handle(HLRBRep_Algo) myAlgo = new HLRBRep_Algo();
|
Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();
|
||||||
|
|
||||||
// Add Shapes into the algorithm
|
// Add Shapes into the algorithm
|
||||||
myAlgo->Add(aShape, nbIso);
|
myAlgo->Add(aShape, nbIso);
|
||||||
@@ -234,7 +234,7 @@ Standard_Boolean HLR_Presentation::HLR(const TopoDS_Shape& aShape, const Standar
|
|||||||
TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();
|
TopoDS_Shape OutLineHCompound = aHLRToShape.OutLineHCompound();
|
||||||
TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();
|
TopoDS_Shape IsoLineHCompound = aHLRToShape.IsoLineHCompound();
|
||||||
|
|
||||||
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
|
Handle_AIS_Shape aShapeIO = drawShape(aShape);
|
||||||
|
|
||||||
if (WAIT_A_SECOND) return Standard_False;
|
if (WAIT_A_SECOND) return Standard_False;
|
||||||
|
|
||||||
@@ -268,13 +268,13 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
|
|||||||
" // triangulating aShape with BRepMesh::Mesh" EOL
|
" // triangulating aShape with BRepMesh::Mesh" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // Build The algorithm object" EOL
|
" // Build The algorithm object" EOL
|
||||||
" Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();" EOL
|
" Handle_HLRBRep_PolyAlgo myPolyAlgo = new HLRBRep_PolyAlgo();" EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" // Add Shapes into the algorithm" EOL
|
" // Add Shapes into the algorithm" EOL
|
||||||
" myPolyAlgo->Load(aShape);" EOL
|
" myPolyAlgo->Load(aShape);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a projector object" EOL
|
" // create a projector object" EOL
|
||||||
" Handle(V3d_View) aView;" EOL
|
" Handle_V3d_View aView;" EOL
|
||||||
" // initializing V3d_View ..." EOL
|
" // initializing V3d_View ..." EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
|
" Standard_Real aProjVecX, aProjVecY, aProjVecZ;" EOL
|
||||||
@@ -286,7 +286,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
|
|||||||
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
|
" Standard_Real aPntX = 0.0, aPntY = 0.0, aPntZ = 0.0;" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a projector object" EOL
|
" // create a projector object" EOL
|
||||||
" Handle(Prs3d_Projector) aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
|
" Handle_Prs3d_Projector aProjector = new Prs3d_Projector(Standard_False, 0.0, " EOL
|
||||||
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
|
" aProjVecX, aProjVecY, aProjVecZ, aPntX, aPntY, aPntZ, aUpX, aUpY, aUpZ);" EOL
|
||||||
" " EOL
|
" " EOL
|
||||||
" // Set The Projector" EOL
|
" // Set The Projector" EOL
|
||||||
@@ -328,7 +328,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
|
|||||||
" Isolines - YELLOW" EOL);
|
" Isolines - YELLOW" EOL);
|
||||||
|
|
||||||
// Build The algorithm object
|
// Build The algorithm object
|
||||||
Handle(HLRBRep_PolyAlgo) myPolyAlgo = new HLRBRep_PolyAlgo();
|
Handle_HLRBRep_PolyAlgo myPolyAlgo = new HLRBRep_PolyAlgo();
|
||||||
|
|
||||||
// Add Shapes into the algorithm
|
// Add Shapes into the algorithm
|
||||||
myPolyAlgo->Load(aShape);
|
myPolyAlgo->Load(aShape);
|
||||||
@@ -367,7 +367,7 @@ Standard_Boolean HLR_Presentation::PolyHLR(const TopoDS_Shape& aShape)
|
|||||||
TopoDS_Shape RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();
|
TopoDS_Shape RgNLineHCompound = aPolyHLRToShape.RgNLineHCompound();
|
||||||
TopoDS_Shape OutLineHCompound = aPolyHLRToShape.OutLineHCompound();
|
TopoDS_Shape OutLineHCompound = aPolyHLRToShape.OutLineHCompound();
|
||||||
|
|
||||||
Handle(AIS_Shape) aShapeIO = drawShape(aShape);
|
Handle_AIS_Shape aShapeIO = drawShape(aShape);
|
||||||
|
|
||||||
if (WAIT_A_SECOND) return Standard_False;
|
if (WAIT_A_SECOND) return Standard_False;
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ Standard_Boolean HLR_Presentation::drawHLR(TopoDS_Shape& aVShape,
|
|||||||
aVShape.Location(aLoc);
|
aVShape.Location(aLoc);
|
||||||
|
|
||||||
// create a look for a line according to aColor and aLineType
|
// create a look for a line according to aColor and aLineType
|
||||||
Handle(AIS_Shape) anIO = drawShape(aVShape, aColor, Standard_False);
|
Handle_AIS_Shape anIO = drawShape(aVShape, aColor, Standard_False);
|
||||||
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
|
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
|
||||||
|
|
||||||
getAISContext()->Display(anIO, HShapeIsNull);
|
getAISContext()->Display(anIO, HShapeIsNull);
|
||||||
@@ -420,7 +420,7 @@ Standard_Boolean HLR_Presentation::drawHLR(TopoDS_Shape& aVShape,
|
|||||||
aHShape.Location(aLoc);
|
aHShape.Location(aLoc);
|
||||||
|
|
||||||
// create a look for a line according to aColor and aLineType
|
// create a look for a line according to aColor and aLineType
|
||||||
Handle(AIS_Shape) anIO = drawShape(aHShape, aColor, Standard_False);
|
Handle_AIS_Shape anIO = drawShape(aHShape, aColor, Standard_False);
|
||||||
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_DASH);
|
anIO->Attributes()->WireAspect()->SetTypeOfLine(Aspect_TOL_DASH);
|
||||||
|
|
||||||
getAISContext()->Display(anIO);
|
getAISContext()->Display(anIO);
|
||||||
@@ -464,7 +464,7 @@ void HLR_Presentation::sampleTorus()
|
|||||||
Standard_Real MinorRadius = 10;
|
Standard_Real MinorRadius = 10;
|
||||||
|
|
||||||
//make torus
|
//make torus
|
||||||
Handle(Geom_ToroidalSurface) aTorSurface = new Geom_ToroidalSurface(anAx3, MajorRadius, MinorRadius);
|
Handle_Geom_ToroidalSurface aTorSurface = new Geom_ToroidalSurface(anAx3, MajorRadius, MinorRadius);
|
||||||
TopoDS_Shell aShape = BRepBuilderAPI_MakeShell(aTorSurface);
|
TopoDS_Shell aShape = BRepBuilderAPI_MakeShell(aTorSurface);
|
||||||
|
|
||||||
Standard_Integer nbIso = 3;
|
Standard_Integer nbIso = 3;
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class Prs3d_Projector;
|
class Handle_Prs3d_Projector;
|
||||||
class gp_Trsf;
|
class gp_Trsf;
|
||||||
class TopLoc_Location;
|
class TopLoc_Location;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
// one phase of iterations
|
// one phase of iterations
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle(Prs3d_Projector) Projector(gp_Trsf& theTrsf);
|
Handle_Prs3d_Projector Projector(gp_Trsf& theTrsf);
|
||||||
Standard_Boolean HLR(const TopoDS_Shape&, const Standard_Integer nbIso);
|
Standard_Boolean HLR(const TopoDS_Shape&, const Standard_Integer nbIso);
|
||||||
Standard_Boolean PolyHLR(const TopoDS_Shape&);
|
Standard_Boolean PolyHLR(const TopoDS_Shape&);
|
||||||
Standard_Boolean drawHLR(TopoDS_Shape&, TopoDS_Shape&, const TopLoc_Location&,
|
Standard_Boolean drawHLR(TopoDS_Shape&, TopoDS_Shape&, const TopLoc_Location&,
|
||||||
|
@@ -70,7 +70,7 @@ void Interpol_Presentation::DoSample()
|
|||||||
// Output : vectors theTan, theNewTan.
|
// Output : vectors theTan, theNewTan.
|
||||||
// Returns : false if failed, true if ok.
|
// Returns : false if failed, true if ok.
|
||||||
//================================================================
|
//================================================================
|
||||||
static Standard_Boolean calculateNewTangent(const Handle(Geom_BSplineCurve)& anInterpolationCurve,
|
static Standard_Boolean calculateNewTangent(const Handle_Geom_BSplineCurve& anInterpolationCurve,
|
||||||
gp_Pnt aPointOnCurve, gp_Vec& theTan, gp_Vec& theNewTan,
|
gp_Pnt aPointOnCurve, gp_Vec& theTan, gp_Vec& theNewTan,
|
||||||
Standard_Real angle)
|
Standard_Real angle)
|
||||||
{
|
{
|
||||||
@@ -128,7 +128,7 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
|
|||||||
" aNoPeriodInterpolate.Perform();" EOL
|
" aNoPeriodInterpolate.Perform();" EOL
|
||||||
" // check results" EOL
|
" // check results" EOL
|
||||||
" if (!aNoPeriodInterpolate.IsDone()) return;" EOL
|
" if (!aNoPeriodInterpolate.IsDone()) return;" EOL
|
||||||
" Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
|
" Handle_Geom_BSplineCurve anInterpolationCurve = aNoPeriodInterpolate.Curve();" EOL EOL
|
||||||
|
|
||||||
" //===================================" EOL
|
" //===================================" EOL
|
||||||
" // Creating a constrained interpolation curve" EOL
|
" // Creating a constrained interpolation curve" EOL
|
||||||
@@ -183,9 +183,9 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
|
|||||||
aNoPeriodInterpolate.Perform();
|
aNoPeriodInterpolate.Perform();
|
||||||
// check results
|
// check results
|
||||||
if (!aNoPeriodInterpolate.IsDone()) return;
|
if (!aNoPeriodInterpolate.IsDone()) return;
|
||||||
Handle(Geom_BSplineCurve) anInterpolationCurve = aNoPeriodInterpolate.Curve();
|
Handle_Geom_BSplineCurve anInterpolationCurve = aNoPeriodInterpolate.Curve();
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aShowCurve = drawCurve(anInterpolationCurve);
|
Handle_AIS_InteractiveObject aShowCurve = drawCurve(anInterpolationCurve);
|
||||||
if (WAIT_A_SECOND) return;
|
if (WAIT_A_SECOND) return;
|
||||||
|
|
||||||
//===================================
|
//===================================
|
||||||
@@ -197,7 +197,7 @@ void Interpol_Presentation::interpolate (Standard_Real aCoords[][3],
|
|||||||
Standard_Real scaleVec = 1;
|
Standard_Real scaleVec = 1;
|
||||||
aCopyFlags->Init(Standard_False);
|
aCopyFlags->Init(Standard_False);
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aShowTan;
|
Handle_AIS_InteractiveObject aShowTan;
|
||||||
for (i = indexes.Lower(); i <= indexes.Upper(); i++)
|
for (i = indexes.Lower(); i <= indexes.Upper(); i++)
|
||||||
{
|
{
|
||||||
gp_Pnt aPoint = aPnts->Value(indexes(i));
|
gp_Pnt aPoint = aPnts->Value(indexes(i));
|
||||||
|
@@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
|
|
||||||
class Geom_BSplineCurve;
|
class Handle_Geom_BSplineCurve;
|
||||||
#include <TColgp_HArray1OfPnt.hxx>
|
class Handle_TColgp_HArray1OfPnt;
|
||||||
#include <TColStd_Array1OfInteger.hxx>
|
class TColStd_Array1OfInteger;
|
||||||
#include <TColStd_Array1OfReal.hxx>
|
class TColStd_Array1OfReal;
|
||||||
|
|
||||||
class Interpol_Presentation : public OCCDemo_Presentation
|
class Interpol_Presentation : public OCCDemo_Presentation
|
||||||
{
|
{
|
||||||
|
@@ -70,7 +70,7 @@ void Intersections_Presentation::DoSample()
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
static Handle(Geom2d_BSplineCurve) create2dBSplineCurve(const Standard_Integer thePoles,
|
static Handle_Geom2d_BSplineCurve create2dBSplineCurve(const Standard_Integer thePoles,
|
||||||
const Standard_Real theCoords[][2])
|
const Standard_Real theCoords[][2])
|
||||||
{
|
{
|
||||||
TColgp_Array1OfPnt2d thePoints(1, thePoles);
|
TColgp_Array1OfPnt2d thePoints(1, thePoles);
|
||||||
@@ -86,7 +86,7 @@ static Handle(Geom2d_BSplineCurve) create2dBSplineCurve(const Standard_Integer t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Handle(Geom_BSplineSurface) createBSplineSurface(const Standard_Real theZCoords[],
|
static Handle_Geom_BSplineSurface createBSplineSurface(const Standard_Real theZCoords[],
|
||||||
const Standard_Real theXStep,
|
const Standard_Real theXStep,
|
||||||
const Standard_Real theYStep,
|
const Standard_Real theYStep,
|
||||||
const Standard_Real theXBound,
|
const Standard_Real theXBound,
|
||||||
|
@@ -145,7 +145,7 @@ void LProps_Presentation::sampleBezierSurface()
|
|||||||
sizeof(aPoints)/(sizeof(Standard_Real)*2), aPoints);
|
sizeof(aPoints)/(sizeof(Standard_Real)*2), aPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LProps_Presentation::showCurveLProps (Handle(Geom_Curve) theCurve,
|
void LProps_Presentation::showCurveLProps (Handle_Geom_Curve theCurve,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
const Standard_Integer theNbPoints,
|
const Standard_Integer theNbPoints,
|
||||||
const Standard_Real thePoints[])
|
const Standard_Real thePoints[])
|
||||||
@@ -283,7 +283,7 @@ void LProps_Presentation::showCurveLProps (Handle(Geom_Curve) theCurve,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LProps_Presentation::showSurfaceLProps (Handle(Geom_Surface) theSurface,
|
void LProps_Presentation::showSurfaceLProps (Handle_Geom_Surface theSurface,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
const Standard_Integer theNbPoints,
|
const Standard_Integer theNbPoints,
|
||||||
const Standard_Real thePoints[][2])
|
const Standard_Real thePoints[][2])
|
||||||
|
@@ -31,13 +31,13 @@ private:
|
|||||||
void samplePBSpline();
|
void samplePBSpline();
|
||||||
void sampleBezierSurface();
|
void sampleBezierSurface();
|
||||||
|
|
||||||
void showCurveLProps (Handle(Geom_Curve) theCurve,
|
void showCurveLProps (Handle_Geom_Curve theCurve,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
const Standard_Integer theNbPoints,
|
const Standard_Integer theNbPoints,
|
||||||
const Standard_Real thePoints[]);
|
const Standard_Real thePoints[]);
|
||||||
// Draws the curve, shows local properties and updates the result dialog
|
// Draws the curve, shows local properties and updates the result dialog
|
||||||
|
|
||||||
void showSurfaceLProps (Handle(Geom_Surface) theSurface,
|
void showSurfaceLProps (Handle_Geom_Surface theSurface,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
const Standard_Integer theNbPoints,
|
const Standard_Integer theNbPoints,
|
||||||
const Standard_Real thePoints[][2]);
|
const Standard_Real thePoints[][2]);
|
||||||
|
@@ -316,7 +316,7 @@ void Offset2d_Presentation::sampleWire2()
|
|||||||
drawAndOffsetWire (aWire, aName, aText);
|
drawAndOffsetWire (aWire, aName, aText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Offset2d_Presentation::drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
|
void Offset2d_Presentation::drawAndOffsetCurve2d (Handle_Geom2d_Curve theCurve,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
TCollection_AsciiString& theText)
|
TCollection_AsciiString& theText)
|
||||||
{
|
{
|
||||||
@@ -339,7 +339,7 @@ void Offset2d_Presentation::drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
|
|||||||
getViewer()->ActiveView()->Update();
|
getViewer()->ActiveView()->Update();
|
||||||
|
|
||||||
// Make offset curves
|
// Make offset curves
|
||||||
Handle(AIS_InteractiveObject) aObj;
|
Handle_AIS_InteractiveObject aObj;
|
||||||
for (int i=1; i <= SampleDescrs[myIndex].nNeg; i++)
|
for (int i=1; i <= SampleDescrs[myIndex].nNeg; i++)
|
||||||
{
|
{
|
||||||
if (WAIT_A_LITTLE)
|
if (WAIT_A_LITTLE)
|
||||||
@@ -381,7 +381,7 @@ void Offset2d_Presentation::drawAndOffsetWire(const TopoDS_Wire& theWire,
|
|||||||
setResultText (theText.ToCString());
|
setResultText (theText.ToCString());
|
||||||
|
|
||||||
// Display theWire
|
// Display theWire
|
||||||
Handle(AIS_InteractiveObject) aObj = new AIS_Shape (theWire);
|
Handle_AIS_InteractiveObject aObj = new AIS_Shape (theWire);
|
||||||
getAISContext()->SetColor (aObj, CurveColor);
|
getAISContext()->SetColor (aObj, CurveColor);
|
||||||
getAISContext()->Display (aObj);
|
getAISContext()->Display (aObj);
|
||||||
getViewer()->InitActiveViews();
|
getViewer()->InitActiveViews();
|
||||||
|
@@ -36,7 +36,7 @@ private:
|
|||||||
void sampleWire1();
|
void sampleWire1();
|
||||||
void sampleWire2();
|
void sampleWire2();
|
||||||
|
|
||||||
void drawAndOffsetCurve2d (Handle(Geom2d_Curve) theCurve,
|
void drawAndOffsetCurve2d (Handle_Geom2d_Curve theCurve,
|
||||||
const Standard_CString theName,
|
const Standard_CString theName,
|
||||||
TCollection_AsciiString& theText);
|
TCollection_AsciiString& theText);
|
||||||
void drawAndOffsetWire (const TopoDS_Wire& theWire,
|
void drawAndOffsetWire (const TopoDS_Wire& theWire,
|
||||||
|
@@ -78,7 +78,7 @@ void PointOnCurve_Presentation::DoSample()
|
|||||||
// Purpose : creating a BSpline Curve
|
// Purpose : creating a BSpline Curve
|
||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
static Handle(Geom_BSplineCurve) CreateCurve()
|
static Handle_Geom_BSplineCurve CreateCurve()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][3] =
|
Standard_Real aCoords[][3] =
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ void PointOnCurve_Presentation::sample1()
|
|||||||
gce_MakeLin aLin(aPoint1, aPoint2);
|
gce_MakeLin aLin(aPoint1, aPoint2);
|
||||||
|
|
||||||
Standard_Real aParam = aPoint1.Distance(aPoint2);
|
Standard_Real aParam = aPoint1.Distance(aPoint2);
|
||||||
Handle(Geom_TrimmedCurve) aSeg = new Geom_TrimmedCurve(new Geom_Line(aLin), 0, aParam);
|
Handle_Geom_TrimmedCurve aSeg = new Geom_TrimmedCurve(new Geom_Line(aLin), 0, aParam);
|
||||||
drawCurve(aSeg, Quantity_NOC_GREEN1);
|
drawCurve(aSeg, Quantity_NOC_GREEN1);
|
||||||
}
|
}
|
||||||
if (WAIT_A_LITTLE) return;
|
if (WAIT_A_LITTLE) return;
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
class Geom_Curve;
|
class Handle_Geom_Curve;
|
||||||
|
|
||||||
class PointOnCurve_Presentation : public OCCDemo_Presentation
|
class PointOnCurve_Presentation : public OCCDemo_Presentation
|
||||||
{
|
{
|
||||||
@@ -18,8 +18,8 @@ public:
|
|||||||
// Construction
|
// Construction
|
||||||
PointOnCurve_Presentation();
|
PointOnCurve_Presentation();
|
||||||
private:
|
private:
|
||||||
Handle(AIS_InteractiveObject) PointOnCurve_Presentation::DrawCurve (
|
Handle_AIS_InteractiveObject PointOnCurve_Presentation::DrawCurve (
|
||||||
Handle(Geom_Curve) theCurve, Quantity_NameOfColor theColor);
|
Handle_Geom_Curve theCurve, Quantity_NameOfColor theColor);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Iteration on samples
|
// Iteration on samples
|
||||||
|
@@ -73,7 +73,7 @@ Projection_Presentation::Projection_Presentation()
|
|||||||
// Function : createCurve
|
// Function : createCurve
|
||||||
// Purpose : returns a BSpline curve with 10 poles
|
// Purpose : returns a BSpline curve with 10 poles
|
||||||
//================================================================
|
//================================================================
|
||||||
static Handle(Geom_BSplineCurve) createCurve()
|
static Handle_Geom_BSplineCurve createCurve()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][3] = {{-6,3,0},{-5,1,0},{-4,0,0},{-2,1,0},{-1,-1,0},
|
Standard_Real aCoords[][3] = {{-6,3,0},{-5,1,0},{-4,0,0},{-2,1,0},{-1,-1,0},
|
||||||
{0,-1,0},{1,0,0},{2,2,0},{3,1,0},{4,0,0}};
|
{0,-1,0},{1,0,0},{2,2,0},{3,1,0},{4,0,0}};
|
||||||
@@ -95,7 +95,7 @@ static Handle(Geom_BSplineCurve) createCurve()
|
|||||||
// Function : createSurface
|
// Function : createSurface
|
||||||
// Purpose : returns a BSpline Surface with 8 poles
|
// Purpose : returns a BSpline Surface with 8 poles
|
||||||
//================================================================
|
//================================================================
|
||||||
static Handle(Geom_BSplineSurface) createSurface()
|
static Handle_Geom_BSplineSurface createSurface()
|
||||||
{
|
{
|
||||||
// define points array
|
// define points array
|
||||||
TColgp_Array2OfPnt aPoints (1,2,1,4);
|
TColgp_Array2OfPnt aPoints (1,2,1,4);
|
||||||
@@ -244,7 +244,7 @@ void Projection_Presentation::sample2()
|
|||||||
" gp_Dir aDir(0,0,1);" EOL
|
" gp_Dir aDir(0,0,1);" EOL
|
||||||
" gp_Ax3 anAx3(aCenterPoint, aDir);" EOL
|
" gp_Ax3 anAx3(aCenterPoint, aDir);" EOL
|
||||||
" Standard_Real Radius = 300;" EOL
|
" Standard_Real Radius = 300;" EOL
|
||||||
" Handle(Geom_CylindricalSurface) aCylSurface =" EOL
|
" Handle_Geom_CylindricalSurface aCylSurface =" EOL
|
||||||
" new Geom_CylindricalSurface(anAx3, Radius);" EOL
|
" new Geom_CylindricalSurface(anAx3, Radius);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // projection of a point onto a surface" EOL
|
" // projection of a point onto a surface" EOL
|
||||||
@@ -277,7 +277,7 @@ void Projection_Presentation::sample2()
|
|||||||
gp_Dir aDir(0,0,1);
|
gp_Dir aDir(0,0,1);
|
||||||
gp_Ax3 anAx3(aCenterPoint, aDir);
|
gp_Ax3 anAx3(aCenterPoint, aDir);
|
||||||
Standard_Real Radius = 300;
|
Standard_Real Radius = 300;
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface =
|
Handle_Geom_CylindricalSurface aCylSurface =
|
||||||
new Geom_CylindricalSurface(anAx3, Radius);
|
new Geom_CylindricalSurface(anAx3, Radius);
|
||||||
|
|
||||||
// projection of a point onto a surface
|
// projection of a point onto a surface
|
||||||
@@ -314,7 +314,7 @@ void Projection_Presentation::sample2()
|
|||||||
if(WAIT_A_LITTLE) return;
|
if(WAIT_A_LITTLE) return;
|
||||||
|
|
||||||
// output cylindrical surface
|
// output cylindrical surface
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface,0,2*PI,-200,300,Standard_True,Standard_True);
|
||||||
|
|
||||||
drawSurface(aCylTrimmed);
|
drawSurface(aCylTrimmed);
|
||||||
@@ -352,21 +352,21 @@ void Projection_Presentation::sample3()
|
|||||||
" // define a planar surface" EOL
|
" // define a planar surface" EOL
|
||||||
" gp_Pnt aPlanePnt(0,0,-100);" EOL
|
" gp_Pnt aPlanePnt(0,0,-100);" EOL
|
||||||
" gp_Dir aPlaneDir(0,0,1);" EOL
|
" gp_Dir aPlaneDir(0,0,1);" EOL
|
||||||
" Handle(Geom_Plane) aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);" EOL
|
" Handle_Geom_Plane aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a cylindrical surface" EOL
|
" // create a cylindrical surface" EOL
|
||||||
" gp_Pnt aCylPnt(-100,0,550);" EOL
|
" gp_Pnt aCylPnt(-100,0,550);" EOL
|
||||||
" gp_Dir aCylDir(0,1,0);" EOL
|
" gp_Dir aCylDir(0,1,0);" EOL
|
||||||
" gp_Ax3 anAx3(aCylPnt, aCylDir);" EOL
|
" gp_Ax3 anAx3(aCylPnt, aCylDir);" EOL
|
||||||
" Standard_Real aRadius = 800;" EOL
|
" Standard_Real aRadius = 800;" EOL
|
||||||
" Handle(Geom_CylindricalSurface) aCylSurface = " EOL
|
" Handle_Geom_CylindricalSurface aCylSurface = " EOL
|
||||||
" new Geom_CylindricalSurface(anAx3, aRadius);" EOL
|
" new Geom_CylindricalSurface(anAx3, aRadius);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // Projection of a curve onto a planar surface" EOL
|
" // Projection of a curve onto a planar surface" EOL
|
||||||
" Handle(Geom_Curve) aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);" EOL
|
" Handle_Geom_Curve aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // Projection of a curve onto a cylindrical surface" EOL
|
" // Projection of a curve onto a cylindrical surface" EOL
|
||||||
" Handle(Geom_Curve) aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);" EOL
|
" Handle_Geom_Curve aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);" EOL
|
||||||
);
|
);
|
||||||
|
|
||||||
// create BSpline curve
|
// create BSpline curve
|
||||||
@@ -378,21 +378,21 @@ void Projection_Presentation::sample3()
|
|||||||
// define a planar surface
|
// define a planar surface
|
||||||
gp_Pnt aPlanePnt(0,0,-100);
|
gp_Pnt aPlanePnt(0,0,-100);
|
||||||
gp_Dir aPlaneDir(0,0,1);
|
gp_Dir aPlaneDir(0,0,1);
|
||||||
Handle(Geom_Plane) aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);
|
Handle_Geom_Plane aPlane = new Geom_Plane(aPlanePnt, aPlaneDir);
|
||||||
|
|
||||||
// create a cylindrical surface
|
// create a cylindrical surface
|
||||||
gp_Pnt aCylPnt(-100,0,550);
|
gp_Pnt aCylPnt(-100,0,550);
|
||||||
gp_Dir aCylDir(0,1,0);
|
gp_Dir aCylDir(0,1,0);
|
||||||
gp_Ax3 anAx3(aCylPnt, aCylDir);
|
gp_Ax3 anAx3(aCylPnt, aCylDir);
|
||||||
Standard_Real aRadius = 800;
|
Standard_Real aRadius = 800;
|
||||||
Handle(Geom_CylindricalSurface) aCylSurface =
|
Handle_Geom_CylindricalSurface aCylSurface =
|
||||||
new Geom_CylindricalSurface(anAx3, aRadius);
|
new Geom_CylindricalSurface(anAx3, aRadius);
|
||||||
|
|
||||||
// Projection of a curve onto a planar surface
|
// Projection of a curve onto a planar surface
|
||||||
Handle(Geom_Curve) aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);
|
Handle_Geom_Curve aPlaneProjCurve = GeomProjLib::Project(aCurve, aPlane);
|
||||||
|
|
||||||
// Projection of a curve onto a cylindrical surface
|
// Projection of a curve onto a cylindrical surface
|
||||||
Handle(Geom_Curve) aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);
|
Handle_Geom_Curve aCylProjCurve = GeomProjLib::Project(aCurve, aCylSurface);
|
||||||
|
|
||||||
// ===== output ===========
|
// ===== output ===========
|
||||||
// output original curve
|
// output original curve
|
||||||
@@ -417,7 +417,7 @@ void Projection_Presentation::sample3()
|
|||||||
getAISContext()->Erase(aProjCurveIO, Standard_False);
|
getAISContext()->Erase(aProjCurveIO, Standard_False);
|
||||||
|
|
||||||
// output the second surface - cylindrical surface
|
// output the second surface - cylindrical surface
|
||||||
Handle(Geom_RectangularTrimmedSurface) aCylTrimmed =
|
Handle_Geom_RectangularTrimmedSurface aCylTrimmed =
|
||||||
new Geom_RectangularTrimmedSurface(aCylSurface,PI/2,-PI/2,-450,550,Standard_True,Standard_True);
|
new Geom_RectangularTrimmedSurface(aCylSurface,PI/2,-PI/2,-450,550,Standard_True,Standard_True);
|
||||||
Handle(AIS_InteractiveObject) aCylIO = drawSurface(
|
Handle(AIS_InteractiveObject) aCylIO = drawSurface(
|
||||||
aCylTrimmed, Quantity_Color(Quantity_NOC_YELLOW), Standard_False);
|
aCylTrimmed, Quantity_Color(Quantity_NOC_YELLOW), Standard_False);
|
||||||
|
@@ -98,7 +98,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
|
|||||||
" TopLoc_Location aLocation;" EOL
|
" TopLoc_Location aLocation;" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // takes the triangulation of the face aFace" EOL
|
" // takes the triangulation of the face aFace" EOL
|
||||||
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL
|
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" if(!aTr.IsNull())" EOL
|
" if(!aTr.IsNull())" EOL
|
||||||
" { " EOL
|
" { " EOL
|
||||||
@@ -224,7 +224,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
|
|||||||
" TopoDS_Face aFace;" EOL
|
" TopoDS_Face aFace;" EOL
|
||||||
" B.MakeFace(aFace, aSurf, Precision::Confusion());" EOL
|
" B.MakeFace(aFace, aSurf, Precision::Confusion());" EOL
|
||||||
" B.Add(aFace, aWire);" EOL
|
" B.Add(aFace, aWire);" EOL
|
||||||
" Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);" EOL
|
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);" EOL
|
||||||
" sfs->Perform();" EOL
|
" sfs->Perform();" EOL
|
||||||
" TopoDS_Shape aFixedFace = sfs->Shape();" EOL
|
" TopoDS_Shape aFixedFace = sfs->Shape();" EOL
|
||||||
" if (aFixedFace.IsNull()) " EOL
|
" if (aFixedFace.IsNull()) " EOL
|
||||||
@@ -251,7 +251,7 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
|
|||||||
TopLoc_Location aLocation;
|
TopLoc_Location aLocation;
|
||||||
|
|
||||||
// takes the triangulation of the face aFace
|
// takes the triangulation of the face aFace
|
||||||
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
||||||
|
|
||||||
if(!aTr.IsNull())
|
if(!aTr.IsNull())
|
||||||
{
|
{
|
||||||
@@ -377,14 +377,14 @@ void Simplify_Presentation::simplify(const TopoDS_Shape& aShape)
|
|||||||
TopoDS_Face aFace;
|
TopoDS_Face aFace;
|
||||||
B.MakeFace(aFace, aSurf, Precision::Confusion());
|
B.MakeFace(aFace, aSurf, Precision::Confusion());
|
||||||
B.Add(aFace, aWire);
|
B.Add(aFace, aWire);
|
||||||
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);
|
Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);
|
||||||
sfs->Perform();
|
sfs->Perform();
|
||||||
TopoDS_Shape aFixedFace = sfs->Shape();
|
TopoDS_Shape aFixedFace = sfs->Shape();
|
||||||
if (aFixedFace.IsNull())
|
if (aFixedFace.IsNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// output surface, make it half transparent
|
// output surface, make it half transparent
|
||||||
Handle(AIS_InteractiveObject) aSurfIO = drawSurface(
|
Handle_AIS_InteractiveObject aSurfIO = drawSurface(
|
||||||
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
|
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
|
||||||
aSurfIO->SetTransparency(0.5);
|
aSurfIO->SetTransparency(0.5);
|
||||||
getAISContext()->Display(aSurfIO, Standard_False);
|
getAISContext()->Display(aSurfIO, Standard_False);
|
||||||
|
@@ -76,7 +76,7 @@ void Sweep_Presentation::DoSample()
|
|||||||
// Auxiliary functions
|
// Auxiliary functions
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static Handle(Geom_Curve) mkBezierCurve(const Standard_Integer nPoles,
|
static Handle_Geom_Curve mkBezierCurve(const Standard_Integer nPoles,
|
||||||
const Standard_Real theCoords[][3],
|
const Standard_Real theCoords[][3],
|
||||||
const Standard_Real aScale = 1,
|
const Standard_Real aScale = 1,
|
||||||
const gp_XYZ& aShift = gp_XYZ(0,0,0))
|
const gp_XYZ& aShift = gp_XYZ(0,0,0))
|
||||||
@@ -90,7 +90,7 @@ static Handle(Geom_Curve) mkBezierCurve(const Standard_Integer nPoles,
|
|||||||
return new Geom_BezierCurve (aPoles);
|
return new Geom_BezierCurve (aPoles);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom_Curve) mkPBSplineCurve(const Standard_Integer nPoles,
|
static Handle_Geom_Curve mkPBSplineCurve(const Standard_Integer nPoles,
|
||||||
const Standard_Real theCoords[][3],
|
const Standard_Real theCoords[][3],
|
||||||
const Standard_Real aScale = 1,
|
const Standard_Real aScale = 1,
|
||||||
const gp_XYZ& aShift = gp_XYZ(0,0,0))
|
const gp_XYZ& aShift = gp_XYZ(0,0,0))
|
||||||
@@ -111,7 +111,7 @@ static Handle(Geom_Curve) mkPBSplineCurve(const Standard_Integer nPoles,
|
|||||||
return new Geom_BSplineCurve (aPoles, aKnots, aMults, 3, Standard_True);
|
return new Geom_BSplineCurve (aPoles, aKnots, aMults, 3, Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom2d_Curve) mk2dBezierCurve(const Standard_Integer nPoles,
|
static Handle_Geom2d_Curve mk2dBezierCurve(const Standard_Integer nPoles,
|
||||||
const Standard_Real theCoords[][2],
|
const Standard_Real theCoords[][2],
|
||||||
const Standard_Real aScale = 1,
|
const Standard_Real aScale = 1,
|
||||||
const gp_XY& aShift = gp_XY(0,0))
|
const gp_XY& aShift = gp_XY(0,0))
|
||||||
@@ -139,7 +139,7 @@ static TopoDS_Wire mkPolygonWire(const Standard_Integer nPoints,
|
|||||||
return aPol.Wire();
|
return aPol.Wire();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom_Curve) mkCurve1()
|
static Handle_Geom_Curve mkCurve1()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][3] = {
|
Standard_Real aCoords[][3] = {
|
||||||
{0,0,0},{0,0,10},{0,10,10},{0,10,20}
|
{0,0,0},{0,0,10},{0,10,10},{0,10,20}
|
||||||
@@ -148,7 +148,7 @@ static Handle(Geom_Curve) mkCurve1()
|
|||||||
return mkBezierCurve (nPoles, aCoords);
|
return mkBezierCurve (nPoles, aCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom_Curve) mkCurve2()
|
static Handle_Geom_Curve mkCurve2()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][3] = {
|
Standard_Real aCoords[][3] = {
|
||||||
{0,0,0},{10,0,0},{20,10,12},{25,30,20},{50,40,50}
|
{0,0,0},{10,0,0},{20,10,12},{25,30,20},{50,40,50}
|
||||||
@@ -157,7 +157,7 @@ static Handle(Geom_Curve) mkCurve2()
|
|||||||
return mkBezierCurve (nPoles, aCoords);
|
return mkBezierCurve (nPoles, aCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom_Curve) mkCurve3()
|
static Handle_Geom_Curve mkCurve3()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][3] = {
|
Standard_Real aCoords[][3] = {
|
||||||
{50,40,50},{70,30,30},{90,20,20},{100,50,0}
|
{50,40,50},{70,30,30},{90,20,20},{100,50,0}
|
||||||
@@ -166,7 +166,7 @@ static Handle(Geom_Curve) mkCurve3()
|
|||||||
return mkBezierCurve (nPoles, aCoords);
|
return mkBezierCurve (nPoles, aCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom2d_Curve) mk2dCurve1()
|
static Handle_Geom2d_Curve mk2dCurve1()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[][2] = {
|
Standard_Real aCoords[][2] = {
|
||||||
{0,0},{0.3,0},{0.1,0.5},{0.3,0.6},{0.6,0.5}
|
{0,0},{0.3,0},{0.1,0.5},{0.3,0.6},{0.6,0.5}
|
||||||
@@ -175,7 +175,7 @@ static Handle(Geom2d_Curve) mk2dCurve1()
|
|||||||
return mk2dBezierCurve (nPoles, aCoords);
|
return mk2dBezierCurve (nPoles, aCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Handle(Geom_Surface) mkSurface1()
|
static Handle_Geom_Surface mkSurface1()
|
||||||
{
|
{
|
||||||
Standard_Real aCoords[3][3][3] = {
|
Standard_Real aCoords[3][3][3] = {
|
||||||
{{-10,-10,-30},{-10,50,40},{-10,70,-20}},
|
{{-10,-10,-30},{-10,50,40},{-10,70,-20}},
|
||||||
@@ -292,9 +292,9 @@ static TopoDS_Wire mkWire9()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) Sweep_Presentation::drawCurveOnSurface
|
Handle_AIS_InteractiveObject Sweep_Presentation::drawCurveOnSurface
|
||||||
(const Handle(Geom2d_Curve)& aC2d,
|
(const Handle_Geom2d_Curve& aC2d,
|
||||||
const Handle(Geom_Surface)& aSurf,
|
const Handle_Geom_Surface& aSurf,
|
||||||
const Quantity_Color& aColor)
|
const Quantity_Color& aColor)
|
||||||
{
|
{
|
||||||
Handle(Geom2dAdaptor_HCurve) aHC = new Geom2dAdaptor_HCurve(aC2d);
|
Handle(Geom2dAdaptor_HCurve) aHC = new Geom2dAdaptor_HCurve(aC2d);
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
class Geom2d_Curve;
|
class Handle_Geom2d_Curve;
|
||||||
class Geom_Surface;
|
class Handle_Geom_Surface;
|
||||||
|
|
||||||
class Sweep_Presentation : public OCCDemo_Presentation
|
class Sweep_Presentation : public OCCDemo_Presentation
|
||||||
{
|
{
|
||||||
@@ -24,9 +24,9 @@ public:
|
|||||||
virtual void DoSample();
|
virtual void DoSample();
|
||||||
// one phase of iterations
|
// one phase of iterations
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawCurveOnSurface
|
Handle_AIS_InteractiveObject drawCurveOnSurface
|
||||||
(const Handle(Geom2d_Curve)& aC2d,
|
(const Handle_Geom2d_Curve& aC2d,
|
||||||
const Handle(Geom_Surface)& aSurf,
|
const Handle_Geom_Surface& aSurf,
|
||||||
const Quantity_Color& aColor);
|
const Quantity_Color& aColor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -123,7 +123,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
|||||||
" TopLoc_Location aLocation;" EOL EOL
|
" TopLoc_Location aLocation;" EOL EOL
|
||||||
|
|
||||||
" // takes the triangulation of the face aFace:" EOL
|
" // takes the triangulation of the face aFace:" EOL
|
||||||
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL EOL
|
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL EOL
|
||||||
|
|
||||||
" if(!aTr.IsNull()) // if this triangulation is not NULL" EOL
|
" if(!aTr.IsNull()) // if this triangulation is not NULL" EOL
|
||||||
" { " EOL
|
" { " EOL
|
||||||
@@ -161,7 +161,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
|||||||
" if(!aEdge.IsNull()) // if this edge is not NULL" EOL
|
" if(!aEdge.IsNull()) // if this edge is not NULL" EOL
|
||||||
" {" EOL
|
" {" EOL
|
||||||
" // takes the polygon associated to the edge aEdge:" EOL
|
" // takes the polygon associated to the edge aEdge:" EOL
|
||||||
" Handle(Poly_PolygonOnTriangulation) aPol = " EOL
|
" Handle_Poly_PolygonOnTriangulation aPol = " EOL
|
||||||
" BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());" EOL EOL
|
" BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());" EOL EOL
|
||||||
|
|
||||||
" if(!aPol.IsNull()) // if this polygon is not NULL" EOL
|
" if(!aPol.IsNull()) // if this polygon is not NULL" EOL
|
||||||
@@ -197,7 +197,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
|||||||
Standard_Integer aNumOfNodes = 0;
|
Standard_Integer aNumOfNodes = 0;
|
||||||
Standard_Integer aNumOfTriangles = 0;
|
Standard_Integer aNumOfTriangles = 0;
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aShowEdge,aShowFace,aShowShape;
|
Handle_AIS_InteractiveObject aShowEdge,aShowFace,aShowShape;
|
||||||
|
|
||||||
TopExp_Explorer aExpFace,aExpEdge;
|
TopExp_Explorer aExpFace,aExpEdge;
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
|||||||
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
|
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
|
||||||
TopLoc_Location aLocation;
|
TopLoc_Location aLocation;
|
||||||
|
|
||||||
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
||||||
|
|
||||||
if(!aTr.IsNull())
|
if(!aTr.IsNull())
|
||||||
{
|
{
|
||||||
@@ -232,7 +232,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
|||||||
|
|
||||||
if(!aEdge.IsNull())
|
if(!aEdge.IsNull())
|
||||||
{
|
{
|
||||||
Handle(Poly_PolygonOnTriangulation) aPol =
|
Handle_Poly_PolygonOnTriangulation aPol =
|
||||||
BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());
|
BRep_Tool::PolygonOnTriangulation(aEdge,aTr,aEdge.Location());
|
||||||
|
|
||||||
if(!aPol.IsNull())
|
if(!aPol.IsNull())
|
||||||
|
@@ -83,7 +83,7 @@ void Textures_Presentation::Init()
|
|||||||
{
|
{
|
||||||
// initialize v3d_view so it displays textures well
|
// initialize v3d_view so it displays textures well
|
||||||
getViewer()->InitActiveViews();
|
getViewer()->InitActiveViews();
|
||||||
Handle(V3d_View) aView = getViewer()->ActiveView();
|
Handle_V3d_View aView = getViewer()->ActiveView();
|
||||||
aView->SetSurfaceDetail(V3d_TEX_ALL);
|
aView->SetSurfaceDetail(V3d_TEX_ALL);
|
||||||
aView->SetSize(ZVIEW_SIZE);
|
aView->SetSize(ZVIEW_SIZE);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ void Textures_Presentation::Init()
|
|||||||
" // aShape = ..." EOL
|
" // aShape = ..." EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a textured presentation object for aShape" EOL
|
" // create a textured presentation object for aShape" EOL
|
||||||
" Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);" EOL
|
" Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" TCollection_AsciiString aTFileName;" EOL
|
" TCollection_AsciiString aTFileName;" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
@@ -142,12 +142,12 @@ void Textures_Presentation::Init()
|
|||||||
//================================================================
|
//================================================================
|
||||||
void Textures_Presentation::lightsOnOff(Standard_Boolean isOn)
|
void Textures_Presentation::lightsOnOff(Standard_Boolean isOn)
|
||||||
{
|
{
|
||||||
static Handle(V3d_Light) aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
|
static Handle_V3d_Light aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
|
||||||
static Handle(V3d_Light) aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
|
static Handle_V3d_Light aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
|
||||||
static Handle(V3d_Light) aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
|
static Handle_V3d_Light aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
|
||||||
static Handle(V3d_Light) aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
|
static Handle_V3d_Light aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
|
||||||
static Handle(V3d_Light) aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
|
static Handle_V3d_Light aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
|
||||||
static Handle(V3d_Light) aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
|
static Handle_V3d_Light aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
|
||||||
|
|
||||||
if (isOn)
|
if (isOn)
|
||||||
{
|
{
|
||||||
@@ -184,7 +184,7 @@ Standard_Boolean Textures_Presentation::displayTextured(const TopoDS_Shape& aSha
|
|||||||
Standard_Integer nRepeat)
|
Standard_Integer nRepeat)
|
||||||
{
|
{
|
||||||
// create a textured presentation object for aShape
|
// create a textured presentation object for aShape
|
||||||
Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);
|
Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);
|
||||||
|
|
||||||
// load texture from file if it is not an integer value
|
// load texture from file if it is not an integer value
|
||||||
// integer value indicates a number of texture in predefined textures enumeration
|
// integer value indicates a number of texture in predefined textures enumeration
|
||||||
@@ -209,7 +209,7 @@ Standard_Boolean Textures_Presentation::displayTextured(const TopoDS_Shape& aSha
|
|||||||
{
|
{
|
||||||
lightsOnOff(Standard_False);
|
lightsOnOff(Standard_False);
|
||||||
|
|
||||||
Handle(AIS_Shape) aAisShape = drawShape(aShape/*, Quantity_NOC_WHITE*/);
|
Handle_AIS_Shape aAisShape = drawShape(aShape/*, Quantity_NOC_WHITE*/);
|
||||||
if (WAIT_A_SECOND) return Standard_False;
|
if (WAIT_A_SECOND) return Standard_False;
|
||||||
getAISContext()->Erase(aAisShape, Standard_False);
|
getAISContext()->Erase(aAisShape, Standard_False);
|
||||||
}
|
}
|
||||||
@@ -391,7 +391,7 @@ void Textures_Presentation::samplePredefTexture2()
|
|||||||
Standard_Real aXStep = 250, aYStep = 250;
|
Standard_Real aXStep = 250, aYStep = 250;
|
||||||
Standard_Real aXBound = -450, aYBound = -300;
|
Standard_Real aXBound = -450, aYBound = -300;
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) aSurface =
|
Handle_Geom_BSplineSurface aSurface =
|
||||||
GeomAPI_PointsToBSplineSurface(aZPoints,aXBound,aXStep,aYBound,aYStep,3,8);
|
GeomAPI_PointsToBSplineSurface(aZPoints,aXBound,aXStep,aYBound,aYStep,3,8);
|
||||||
|
|
||||||
TopoDS_Face aShape = BRepBuilderAPI_MakeFace(aSurface);
|
TopoDS_Face aShape = BRepBuilderAPI_MakeFace(aSurface);
|
||||||
|
@@ -70,7 +70,7 @@ void TexturesExt_Presentation::Init()
|
|||||||
{
|
{
|
||||||
// initialize v3d_view so it displays TexturesExt well
|
// initialize v3d_view so it displays TexturesExt well
|
||||||
getViewer()->InitActiveViews();
|
getViewer()->InitActiveViews();
|
||||||
Handle(V3d_View) aView = getViewer()->ActiveView();
|
Handle_V3d_View aView = getViewer()->ActiveView();
|
||||||
aView->SetSurfaceDetail(V3d_TEX_ALL);
|
aView->SetSurfaceDetail(V3d_TEX_ALL);
|
||||||
aView->SetSize(ZVIEW_SIZE);
|
aView->SetSize(ZVIEW_SIZE);
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ void TexturesExt_Presentation::Init()
|
|||||||
" // aShape = ..." EOL
|
" // aShape = ..." EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" // create a textured presentation object for aShape" EOL
|
" // create a textured presentation object for aShape" EOL
|
||||||
" Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);" EOL
|
" Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
" TCollection_AsciiString aTFileName;" EOL
|
" TCollection_AsciiString aTFileName;" EOL
|
||||||
"" EOL
|
"" EOL
|
||||||
@@ -124,7 +124,7 @@ void TexturesExt_Presentation::Init()
|
|||||||
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
||||||
// is loaded.
|
// is loaded.
|
||||||
//================================================================
|
//================================================================
|
||||||
Handle(AIS_TexturedShape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
|
Handle_AIS_TexturedShape TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
|
||||||
TCollection_AsciiString aTFileName,
|
TCollection_AsciiString aTFileName,
|
||||||
Standard_Real toScaleU,
|
Standard_Real toScaleU,
|
||||||
Standard_Real toScaleV,
|
Standard_Real toScaleV,
|
||||||
@@ -134,7 +134,7 @@ Handle(AIS_TexturedShape) TexturesExt_Presentation::Texturize(const TopoDS_Shape
|
|||||||
Standard_Real originV)
|
Standard_Real originV)
|
||||||
{
|
{
|
||||||
// create a textured presentation object for aShape
|
// create a textured presentation object for aShape
|
||||||
Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);
|
Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);
|
||||||
|
|
||||||
// load texture from file if it is not an integer value
|
// load texture from file if it is not an integer value
|
||||||
// integer value indicates a number of texture in predefined TexturesExt enumeration
|
// integer value indicates a number of texture in predefined TexturesExt enumeration
|
||||||
@@ -190,12 +190,12 @@ Standard_Boolean TexturesExt_Presentation::loadShape(TopoDS_Shape& aShape,
|
|||||||
//================================================================
|
//================================================================
|
||||||
void TexturesExt_Presentation::lightsOnOff(Standard_Boolean isOn)
|
void TexturesExt_Presentation::lightsOnOff(Standard_Boolean isOn)
|
||||||
{
|
{
|
||||||
static Handle(V3d_Light) aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
|
static Handle_V3d_Light aLight1 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZneg);
|
||||||
static Handle(V3d_Light) aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
|
static Handle_V3d_Light aLight2 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZpos);
|
||||||
static Handle(V3d_Light) aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
|
static Handle_V3d_Light aLight3 = new V3d_DirectionalLight(getViewer(), V3d_XposYnegZpos);
|
||||||
static Handle(V3d_Light) aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
|
static Handle_V3d_Light aLight4 = new V3d_DirectionalLight(getViewer(), V3d_XnegYnegZneg);
|
||||||
static Handle(V3d_Light) aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
|
static Handle_V3d_Light aLight5 = new V3d_DirectionalLight(getViewer(), V3d_XnegYposZpos);
|
||||||
static Handle(V3d_Light) aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
|
static Handle_V3d_Light aLight6 = new V3d_DirectionalLight(getViewer(), V3d_XposYposZpos);
|
||||||
|
|
||||||
if (isOn)
|
if (isOn)
|
||||||
{
|
{
|
||||||
@@ -238,14 +238,14 @@ void TexturesExt_Presentation::sampleBottle()
|
|||||||
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
|
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
|
||||||
|
|
||||||
// display original shape in shaded display mode
|
// display original shape in shaded display mode
|
||||||
Handle(AIS_Shape) aShapeIO = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
Handle_AIS_Shape aShapeIO = drawShape(aShape, Graphic3d_NOM_BRASS, Standard_False);
|
||||||
getAISContext()->SetDisplayMode(aShapeIO, AIS_Shaded, Standard_False);
|
getAISContext()->SetDisplayMode(aShapeIO, AIS_Shaded, Standard_False);
|
||||||
DISP(aShapeIO);
|
DISP(aShapeIO);
|
||||||
|
|
||||||
Handle(AIS_TexturedShape) aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
|
Handle_AIS_TexturedShape aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
|
||||||
DISP(aTFace1);
|
DISP(aTFace1);
|
||||||
|
|
||||||
Handle(AIS_TexturedShape) aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
|
Handle_AIS_TexturedShape aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
|
||||||
DISP(aTFace2);
|
DISP(aTFace2);
|
||||||
|
|
||||||
getViewer()->Update();
|
getViewer()->Update();
|
||||||
@@ -267,7 +267,7 @@ void TexturesExt_Presentation::sampleTerrain()
|
|||||||
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
|
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
|
||||||
|
|
||||||
// TopLoc_Location aLoc;
|
// TopLoc_Location aLoc;
|
||||||
// Handle(Geom_Surface) aSur = BRep_Tool::Surface(TopoDS::Face(aFaces(1)), aLoc);
|
// Handle_Geom_Surface aSur = BRep_Tool::Surface(TopoDS::Face(aFaces(1)), aLoc);
|
||||||
// Standard_Real u1,u2,v1,v2;
|
// Standard_Real u1,u2,v1,v2;
|
||||||
// aSur->Bounds(u1,u2,v1,v2);
|
// aSur->Bounds(u1,u2,v1,v2);
|
||||||
// gp_Pnt aPnt = aSur->Value(u1, v1);
|
// gp_Pnt aPnt = aSur->Value(u1, v1);
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class TCollection_AsciiString;
|
class TCollection_AsciiString;
|
||||||
class AIS_TexturedShape;
|
class Handle_AIS_TexturedShape;
|
||||||
|
|
||||||
class TexturesExt_Presentation : public OCCDemo_Presentation
|
class TexturesExt_Presentation : public OCCDemo_Presentation
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ private:
|
|||||||
// filename can also be an integer value ("2", "5", etc.), in this case
|
// filename can also be an integer value ("2", "5", etc.), in this case
|
||||||
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
||||||
// is loaded.
|
// is loaded.
|
||||||
Handle(AIS_TexturedShape) Texturize(
|
Handle_AIS_TexturedShape Texturize(
|
||||||
const TopoDS_Shape& aShape, TCollection_AsciiString aTFileName,
|
const TopoDS_Shape& aShape, TCollection_AsciiString aTFileName,
|
||||||
Standard_Real toScaleU=1.0, Standard_Real toScaleV=1.0,
|
Standard_Real toScaleU=1.0, Standard_Real toScaleV=1.0,
|
||||||
Standard_Real toRepeatU=1.0, Standard_Real toRepeatV=1.0,
|
Standard_Real toRepeatU=1.0, Standard_Real toRepeatV=1.0,
|
||||||
|
@@ -77,7 +77,7 @@ void ThruSections_Presentation::DoSample()
|
|||||||
// purpose:
|
// purpose:
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static Handle(Geom_BSplineCurve) CreateCurve(Standard_Real aCoords[][3],Standard_Integer nPoles)
|
static Handle_Geom_BSplineCurve CreateCurve(Standard_Real aCoords[][3],Standard_Integer nPoles)
|
||||||
{
|
{
|
||||||
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
TColgp_Array1OfPnt aCurvePoint (1, nPoles);
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ void ThruSections_Presentation::sample1()
|
|||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aShow1,aShow2,aShowWire;
|
Handle_AIS_InteractiveObject aShow1,aShow2,aShowWire;
|
||||||
|
|
||||||
// this data used for building a shape through sections:
|
// this data used for building a shape through sections:
|
||||||
Standard_Boolean IsSolid,IsRuled;
|
Standard_Boolean IsSolid,IsRuled;
|
||||||
@@ -374,7 +374,7 @@ void ThruSections_Presentation::sample2()
|
|||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) aShow1,aShow2,aShowWire1,aShowWire2,aShowWire3;
|
Handle_AIS_InteractiveObject aShow1,aShow2,aShowWire1,aShowWire2,aShowWire3;
|
||||||
|
|
||||||
// this data used for building a shape through sections:
|
// this data used for building a shape through sections:
|
||||||
const Standard_Boolean IsSolid = Standard_False;
|
const Standard_Boolean IsSolid = Standard_False;
|
||||||
@@ -403,8 +403,8 @@ void ThruSections_Presentation::sample2()
|
|||||||
Standard_Integer aSize3 = sizeof(aCoords3)/(sizeof(Standard_Real)*3);
|
Standard_Integer aSize3 = sizeof(aCoords3)/(sizeof(Standard_Real)*3);
|
||||||
|
|
||||||
// creates curves:
|
// creates curves:
|
||||||
Handle(Geom_BSplineCurve) aCurve1 = CreateCurve(aCoords1,aSize1);
|
Handle_Geom_BSplineCurve aCurve1 = CreateCurve(aCoords1,aSize1);
|
||||||
Handle(Geom_BSplineCurve) aCurve2 = CreateCurve(aCoords2,aSize2);
|
Handle_Geom_BSplineCurve aCurve2 = CreateCurve(aCoords2,aSize2);
|
||||||
|
|
||||||
// creates wires based on the curves:
|
// creates wires based on the curves:
|
||||||
TopoDS_Wire aW1 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(aCurve1));
|
TopoDS_Wire aW1 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(aCurve1));
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include <OCCDemo_Presentation.h>
|
#include <OCCDemo_Presentation.h>
|
||||||
#include <TopTools_SequenceOfShape.hxx>
|
class TopTools_SequenceOfShape;
|
||||||
//class TCollection_AsciiString;
|
//class TCollection_AsciiString;
|
||||||
|
|
||||||
class ThruSections_Presentation : public OCCDemo_Presentation
|
class ThruSections_Presentation : public OCCDemo_Presentation
|
||||||
|
@@ -126,10 +126,10 @@ static TopoDS_Shape CreateRevolShape()
|
|||||||
|
|
||||||
gp_Ax1 anAxis = gp_Ax1(gp_Pnt(0,0,0),gp::DY());
|
gp_Ax1 anAxis = gp_Ax1(gp_Pnt(0,0,0),gp::DY());
|
||||||
GC_MakeSegment aSegment(gp_Pnt(0,-8*SCALE,0),gp_Pnt(0,-8*SCALE,2*SCALE));
|
GC_MakeSegment aSegment(gp_Pnt(0,-8*SCALE,0),gp_Pnt(0,-8*SCALE,2*SCALE));
|
||||||
Handle(Geom_TrimmedCurve) aLine = aSegment.Value();
|
Handle_Geom_TrimmedCurve aLine = aSegment.Value();
|
||||||
Handle(Geom_SurfaceOfRevolution) aSurface1 = new Geom_SurfaceOfRevolution(aLine, anAxis);
|
Handle_Geom_SurfaceOfRevolution aSurface1 = new Geom_SurfaceOfRevolution(aLine, anAxis);
|
||||||
Handle(Geom_SurfaceOfRevolution) aSurface2 = new Geom_SurfaceOfRevolution(aCurve1, anAxis);
|
Handle_Geom_SurfaceOfRevolution aSurface2 = new Geom_SurfaceOfRevolution(aCurve1, anAxis);
|
||||||
Handle(Geom_SurfaceOfRevolution) aSurface3 = new Geom_SurfaceOfRevolution(aCurve2, anAxis);
|
Handle_Geom_SurfaceOfRevolution aSurface3 = new Geom_SurfaceOfRevolution(aCurve2, anAxis);
|
||||||
|
|
||||||
BRep_Builder aBuilder;
|
BRep_Builder aBuilder;
|
||||||
TopoDS_Compound aShape;
|
TopoDS_Compound aShape;
|
||||||
@@ -214,10 +214,10 @@ static TopoDS_Shape CreateBSplnShape()
|
|||||||
|
|
||||||
GeomAPI_PointsToBSplineSurface aPTBS;
|
GeomAPI_PointsToBSplineSurface aPTBS;
|
||||||
aPTBS.Init(aZPoints1,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
|
aPTBS.Init(aZPoints1,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
|
||||||
Handle(Geom_BSplineSurface) aSurface1 = aPTBS.Surface();
|
Handle_Geom_BSplineSurface aSurface1 = aPTBS.Surface();
|
||||||
|
|
||||||
aPTBS.Init(aZPoints2,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
|
aPTBS.Init(aZPoints2,aX0,aXStep,aY0,aYStep,3,10,GeomAbs_C3,0.3*SCALE);
|
||||||
Handle(Geom_BSplineSurface) aSurface2 = aPTBS.Surface();
|
Handle_Geom_BSplineSurface aSurface2 = aPTBS.Surface();
|
||||||
|
|
||||||
TopoDS_Face aFace1,aFace2;
|
TopoDS_Face aFace1,aFace2;
|
||||||
aFace1 = BRepBuilderAPI_MakeFace (aSurface1);
|
aFace1 = BRepBuilderAPI_MakeFace (aSurface1);
|
||||||
@@ -251,7 +251,7 @@ void TopLProps_Presentation::sample1()
|
|||||||
if (aEdge.IsNull()) return;
|
if (aEdge.IsNull()) return;
|
||||||
|
|
||||||
//show:
|
//show:
|
||||||
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
|
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
drawShape(aEdge,Quantity_NOC_RED);
|
drawShape(aEdge,Quantity_NOC_RED);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
@@ -281,9 +281,9 @@ void TopLProps_Presentation::sample2()
|
|||||||
if (aFace.IsNull()) return;
|
if (aFace.IsNull()) return;
|
||||||
|
|
||||||
//show:
|
//show:
|
||||||
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
|
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
Handle(AIS_InteractiveObject) aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
|
Handle_AIS_InteractiveObject aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
|
||||||
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
|
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
|
||||||
getAISContext()->Display(aShowFace);
|
getAISContext()->Display(aShowFace);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
@@ -324,7 +324,7 @@ void TopLProps_Presentation::sample3()
|
|||||||
Standard_Integer aNbPoints = sizeof(aPoints)/sizeof(Standard_Real);
|
Standard_Integer aNbPoints = sizeof(aPoints)/sizeof(Standard_Real);
|
||||||
|
|
||||||
//show:
|
//show:
|
||||||
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
|
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
|
|
||||||
drawShape(aEdge,Quantity_NOC_RED);
|
drawShape(aEdge,Quantity_NOC_RED);
|
||||||
@@ -367,9 +367,9 @@ void TopLProps_Presentation::sample4()
|
|||||||
Standard_Integer aNbPoints = sizeof(aPoints)/(sizeof(Standard_Real)*2);
|
Standard_Integer aNbPoints = sizeof(aPoints)/(sizeof(Standard_Real)*2);
|
||||||
|
|
||||||
//show:
|
//show:
|
||||||
Handle(AIS_InteractiveObject) aShowShape = drawShape(aShape);
|
Handle_AIS_InteractiveObject aShowShape = drawShape(aShape);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
Handle(AIS_InteractiveObject) aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
|
Handle_AIS_InteractiveObject aShowFace = drawShape(aFace,Graphic3d_NOM_BRASS,Standard_False);
|
||||||
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
|
getAISContext()->SetDisplayMode(aShowFace,AIS_WireFrame);
|
||||||
getAISContext()->Display(aShowFace);
|
getAISContext()->Display(aShowFace);
|
||||||
if(WAIT_A_SECOND) return;
|
if(WAIT_A_SECOND) return;
|
||||||
@@ -439,7 +439,7 @@ void TopLProps_Presentation::showEdgeLProps(TopoDS_Edge& theEdge,
|
|||||||
setResultText (aText.ToCString());
|
setResultText (aText.ToCString());
|
||||||
|
|
||||||
BRepAdaptor_Curve anAdapCurve (theEdge) ;
|
BRepAdaptor_Curve anAdapCurve (theEdge) ;
|
||||||
Handle(AIS_InteractiveObject) aObjs[7];
|
Handle_AIS_InteractiveObject aObjs[7];
|
||||||
Standard_Integer maxOrder = 3;
|
Standard_Integer maxOrder = 3;
|
||||||
Standard_Real aResol = gp::Resolution();
|
Standard_Real aResol = gp::Resolution();
|
||||||
BRepLProp_CLProps aLProps (anAdapCurve,maxOrder,aResol);
|
BRepLProp_CLProps aLProps (anAdapCurve,maxOrder,aResol);
|
||||||
|
@@ -44,18 +44,18 @@ public:
|
|||||||
Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName);
|
Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName);
|
||||||
Standard_EXPORT void Build(const Standard_CString aGroundName) ;
|
Standard_EXPORT void Build(const Standard_CString aGroundName) ;
|
||||||
Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ;
|
Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ;
|
||||||
Standard_EXPORT Handle(Geom_BSplineSurface) Surface() const;
|
Standard_EXPORT Handle_Geom_BSplineSurface Surface() const;
|
||||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Methods PRIVATE
|
// Methods PRIVATE
|
||||||
//
|
//
|
||||||
Standard_EXPORT Handle(Geom_BSplineSurface) Read(const Standard_CString aGroundName) ;
|
Standard_EXPORT Handle_Geom_BSplineSurface Read(const Standard_CString aGroundName) ;
|
||||||
|
|
||||||
// Fields PRIVATE
|
// Fields PRIVATE
|
||||||
//
|
//
|
||||||
Handle(Geom_BSplineSurface) myGround;
|
Handle_Geom_BSplineSurface myGround;
|
||||||
Standard_Boolean myIsDone;
|
Standard_Boolean myIsDone;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -1119,7 +1119,7 @@ void CGeometryDoc::OnCreateSol()
|
|||||||
TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol, Precision::Confusion());
|
TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol, Precision::Confusion());
|
||||||
if (!BRepAlgo::IsValid(aface))
|
if (!BRepAlgo::IsValid(aface))
|
||||||
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!", L"CasCade Error", MB_ICONERROR);
|
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : The plate surface is not valid!", L"CasCade Error", MB_ICONERROR);
|
||||||
Handle(AIS_Shape) anAISShape=new AIS_Shape(aface);
|
Handle_AIS_Shape anAISShape=new AIS_Shape(aface);
|
||||||
myAISContext->Display(anAISShape, Standard_False);
|
myAISContext->Display(anAISShape, Standard_False);
|
||||||
Fit();
|
Fit();
|
||||||
}
|
}
|
||||||
@@ -1211,7 +1211,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
|
|||||||
" TopLoc_Location aLocation;\n"
|
" TopLoc_Location aLocation;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" // takes the triangulation of the face aFace\n"
|
" // takes the triangulation of the face aFace\n"
|
||||||
" Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);\n"
|
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if(!aTr.IsNull())\n"
|
" if(!aTr.IsNull())\n"
|
||||||
" { \n"
|
" { \n"
|
||||||
@@ -1337,7 +1337,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
|
|||||||
" TopoDS_Face aFace;\n"
|
" TopoDS_Face aFace;\n"
|
||||||
" B.MakeFace(aFace, aSurf, Precision::Confusion());\n"
|
" B.MakeFace(aFace, aSurf, Precision::Confusion());\n"
|
||||||
" B.Add(aFace, aWire);\n"
|
" B.Add(aFace, aWire);\n"
|
||||||
" Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);\n"
|
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);\n"
|
||||||
" sfs->Perform();\n"
|
" sfs->Perform();\n"
|
||||||
" TopoDS_Shape aFixedFace = sfs->Shape();\n"
|
" TopoDS_Shape aFixedFace = sfs->Shape();\n"
|
||||||
" if (aFixedFace.IsNull()) \n"
|
" if (aFixedFace.IsNull()) \n"
|
||||||
@@ -1364,7 +1364,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
|
|||||||
TopLoc_Location aLocation;
|
TopLoc_Location aLocation;
|
||||||
|
|
||||||
// takes the triangulation of the face aFace
|
// takes the triangulation of the face aFace
|
||||||
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
||||||
|
|
||||||
if(!aTr.IsNull())
|
if(!aTr.IsNull())
|
||||||
{
|
{
|
||||||
@@ -1492,14 +1492,14 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
|
|||||||
TopoDS_Face aFace;
|
TopoDS_Face aFace;
|
||||||
B.MakeFace(aFace, aSurf, Precision::Confusion());
|
B.MakeFace(aFace, aSurf, Precision::Confusion());
|
||||||
B.Add(aFace, aWire);
|
B.Add(aFace, aWire);
|
||||||
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape(aFace);
|
Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);
|
||||||
sfs->Perform();
|
sfs->Perform();
|
||||||
TopoDS_Shape aFixedFace = sfs->Shape();
|
TopoDS_Shape aFixedFace = sfs->Shape();
|
||||||
if (aFixedFace.IsNull())
|
if (aFixedFace.IsNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// output surface, make it half transparent
|
// output surface, make it half transparent
|
||||||
Handle(AIS_InteractiveObject) aSurfIO = drawSurface(
|
Handle_AIS_InteractiveObject aSurfIO = drawSurface(
|
||||||
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
|
aSurf, Quantity_NOC_LEMONCHIFFON3, Standard_False);
|
||||||
aSurfIO->SetTransparency(0.5);
|
aSurfIO->SetTransparency(0.5);
|
||||||
myAISContext->Display(aSurfIO,Standard_False);
|
myAISContext->Display(aSurfIO,Standard_False);
|
||||||
@@ -1517,8 +1517,8 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
|
|||||||
drawShape(aFixedFace);
|
drawShape(aFixedFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface
|
Handle_AIS_InteractiveObject CGeometryDoc::drawSurface
|
||||||
(const Handle(Geom_Surface)& theSurface,
|
(const Handle_Geom_Surface& theSurface,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
@@ -1529,7 +1529,7 @@ Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface
|
|||||||
fixParam(v1);
|
fixParam(v1);
|
||||||
fixParam(v2);
|
fixParam(v2);
|
||||||
|
|
||||||
Handle(AIS_Shape) aGraphicSurface =
|
Handle_AIS_Shape aGraphicSurface =
|
||||||
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
|
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
|
||||||
|
|
||||||
myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
|
myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
|
||||||
@@ -1569,7 +1569,7 @@ Standard_Boolean CGeometryDoc::WaitForInput (unsigned long aMilliSeconds)
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_Point) CGeometryDoc::drawPoint
|
Handle_AIS_Point CGeometryDoc::drawPoint
|
||||||
(const gp_Pnt& aPnt,
|
(const gp_Pnt& aPnt,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
@@ -1586,12 +1586,12 @@ Handle(AIS_Point) CGeometryDoc::drawPoint
|
|||||||
return aGraphicPoint;
|
return aGraphicPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_Shape) CGeometryDoc::drawShape
|
Handle_AIS_Shape CGeometryDoc::drawShape
|
||||||
(const TopoDS_Shape& theShape,
|
(const TopoDS_Shape& theShape,
|
||||||
const Graphic3d_NameOfMaterial theMaterial,
|
const Graphic3d_NameOfMaterial theMaterial,
|
||||||
const Standard_Boolean toDisplay)
|
const Standard_Boolean toDisplay)
|
||||||
{
|
{
|
||||||
Handle(AIS_Shape) aGraphicShape = new AIS_Shape(theShape);
|
Handle_AIS_Shape aGraphicShape = new AIS_Shape(theShape);
|
||||||
|
|
||||||
myAISContext->SetMaterial(aGraphicShape, theMaterial, toDisplay);
|
myAISContext->SetMaterial(aGraphicShape, theMaterial, toDisplay);
|
||||||
if (toDisplay)
|
if (toDisplay)
|
||||||
|
@@ -30,26 +30,26 @@ public:
|
|||||||
void DragEvent2D (const Standard_Integer x ,
|
void DragEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Standard_Integer TheState,
|
const Standard_Integer TheState,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void InputEvent2D (const Standard_Integer x ,
|
void InputEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void MoveEvent2D (const Standard_Integer x ,
|
void MoveEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void ShiftMoveEvent2D (const Standard_Integer x ,
|
void ShiftMoveEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void ShiftDragEvent2D (const Standard_Integer x ,
|
void ShiftDragEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Standard_Integer TheState,
|
const Standard_Integer TheState,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void ShiftInputEvent2D (const Standard_Integer x ,
|
void ShiftInputEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
void Popup2D (const Standard_Integer x ,
|
void Popup2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle(V3d_View)& aView );
|
const Handle_V3d_View& aView );
|
||||||
|
|
||||||
//-------------------- 3D -------------------//
|
//-------------------- 3D -------------------//
|
||||||
|
|
||||||
@@ -61,21 +61,21 @@ public:
|
|||||||
const Standard_Integer theMouseY,
|
const Standard_Integer theMouseY,
|
||||||
const Handle(V3d_View)& theView);
|
const Handle(V3d_View)& theView);
|
||||||
|
|
||||||
Handle(AIS_InteractiveObject) drawSurface
|
Handle_AIS_InteractiveObject drawSurface
|
||||||
(const Handle(Geom_Surface)& theSurface,
|
(const Handle_Geom_Surface& theSurface,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay);
|
const Standard_Boolean toDisplay);
|
||||||
|
|
||||||
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
||||||
// Waits for a user input or a period of time has been elapsed
|
// Waits for a user input or a period of time has been elapsed
|
||||||
|
|
||||||
Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
|
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given point
|
// creates a presentation of the given point
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
|
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
|
||||||
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given shape with the given material
|
// creates a presentation of the given shape with the given material
|
||||||
@@ -224,16 +224,16 @@ public:
|
|||||||
int Current;
|
int Current;
|
||||||
void Minimize3D();
|
void Minimize3D();
|
||||||
void Minimize2D();
|
void Minimize2D();
|
||||||
Handle(V3d_Viewer) GetViewer2D() { return myViewer2D; };
|
Handle_V3d_Viewer GetViewer2D() { return myViewer2D; };
|
||||||
Handle(AIS_InteractiveContext)& GetISessionContext() { return myAISContext2D; };
|
Handle_AIS_InteractiveContext& GetISessionContext() { return myAISContext2D; };
|
||||||
BOOL FitMode;
|
BOOL FitMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CResultDialog myCResultDialog;
|
CResultDialog myCResultDialog;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle(V3d_Viewer) myViewer2D;
|
Handle_V3d_Viewer myViewer2D;
|
||||||
Handle(AIS_InteractiveContext) myAISContext2D;
|
Handle_AIS_InteractiveContext myAISContext2D;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -8,10 +8,11 @@
|
|||||||
#include <TColStd_Array1OfReal.hxx>
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
#include <Geom2d_BSplineCurve.hxx>
|
#include <Geom2d_BSplineCurve.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
|
||||||
|
|
||||||
|
|
||||||
ISession2D_Curve::ISession2D_Curve(const Handle(Geom2d_Curve) aGeom2dCurve,
|
ISession2D_Curve::ISession2D_Curve(const Handle_Geom2d_Curve aGeom2dCurve,
|
||||||
const Aspect_TypeOfLine aTypeOfLine,
|
const Aspect_TypeOfLine aTypeOfLine,
|
||||||
const Aspect_WidthOfLine aWidthOfLine,
|
const Aspect_WidthOfLine aWidthOfLine,
|
||||||
const Standard_Integer aColorIndex)
|
const Standard_Integer aColorIndex)
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
|
|
||||||
#include <TColGeom2d_HSequenceOfCurve.hxx>
|
class TColGeom2d_HSequenceOfCurve;
|
||||||
class PrsMgr_PresentationManager2d;
|
class PrsMgr_PresentationManager2d;
|
||||||
class Graphic2d_GraphicObject;
|
class Graphic2d_GraphicObject;
|
||||||
class SelectMgr_Selection;
|
class SelectMgr_Selection;
|
||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
//
|
//
|
||||||
|
|
||||||
ISession2D_Curve
|
ISession2D_Curve
|
||||||
(const Handle(Geom2d_Curve) aGeom2dCurve,
|
(const Handle_Geom2d_Curve aGeom2dCurve,
|
||||||
const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID,
|
const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID,
|
||||||
const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM,
|
const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM,
|
||||||
const Standard_Integer aColorIndex = 4);
|
const Standard_Integer aColorIndex = 4);
|
||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
inline Standard_Real GetDiscretisation() const;
|
inline Standard_Real GetDiscretisation() const;
|
||||||
inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ;
|
inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ;
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(ISession2D_Curve,AIS_InteractiveObject)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ private:
|
|||||||
|
|
||||||
// Fields PRIVATE
|
// Fields PRIVATE
|
||||||
//
|
//
|
||||||
Handle(Geom2d_Curve) myGeom2dCurve;
|
Handle_Geom2d_Curve myGeom2dCurve;
|
||||||
Aspect_TypeOfLine myTypeOfLine;
|
Aspect_TypeOfLine myTypeOfLine;
|
||||||
Aspect_WidthOfLine myWidthOfLine;
|
Aspect_WidthOfLine myWidthOfLine;
|
||||||
Standard_Integer myColorIndex;
|
Standard_Integer myColorIndex;
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "ISession_Curve.h"
|
#include "ISession_Curve.h"
|
||||||
#include <StdPrs_PoleCurve.hxx>
|
#include <StdPrs_PoleCurve.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
@@ -20,7 +20,7 @@ public:
|
|||||||
ISession_Curve(Handle(Geom_Curve)& aCurve);
|
ISession_Curve(Handle(Geom_Curve)& aCurve);
|
||||||
virtual ~ISession_Curve();
|
virtual ~ISession_Curve();
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(ISession_Curve,AIS_InteractiveObject)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
static char THIS_FILE[]=__FILE__;
|
static char THIS_FILE[]=__FILE__;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -26,7 +26,7 @@ public:
|
|||||||
ISession_Direction (const gp_Pnt2d& aPnt2d,const gp_Vec2d& aVec2d);
|
ISession_Direction (const gp_Pnt2d& aPnt2d,const gp_Vec2d& aVec2d);
|
||||||
|
|
||||||
virtual ~ISession_Direction();
|
virtual ~ISession_Direction();
|
||||||
DEFINE_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(ISession_Direction,AIS_InteractiveObject)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
static char THIS_FILE[]=__FILE__;
|
static char THIS_FILE[]=__FILE__;
|
||||||
//#define new DEBUG_NEW
|
//#define new DEBUG_NEW
|
||||||
#endif
|
#endif
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession_Point,AIS_InteractiveObject)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -22,7 +22,7 @@ public:
|
|||||||
ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
|
ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
|
||||||
ISession_Point(const gp_Pnt& aPoint);
|
ISession_Point(const gp_Pnt& aPoint);
|
||||||
virtual ~ISession_Point();
|
virtual ~ISession_Point();
|
||||||
DEFINE_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
|
DEFINE_STANDARD_RTTI(ISession_Point,AIS_InteractiveObject)
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
static char THIS_FILE[]=__FILE__;
|
static char THIS_FILE[]=__FILE__;
|
||||||
//#define new DEBUG_NEW
|
//#define new DEBUG_NEW
|
||||||
#endif
|
#endif
|
||||||
|
IMPLEMENT_STANDARD_HANDLE(ISession_Surface,AIS_InteractiveObject)
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|