mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
61f7249b4c |
@@ -930,9 +930,6 @@ if (WIN32)
|
||||
OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
|
||||
# install env script
|
||||
install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
|
||||
# copy build.bat and install.bat scripts to CMake binary folder
|
||||
OCCT_COPY_FILE_OR_DIR ("adm/templates/build.bat" "${CMAKE_BINARY_DIR}")
|
||||
OCCT_COPY_FILE_OR_DIR ("adm/templates/install.bat" "${CMAKE_BINARY_DIR}")
|
||||
else()
|
||||
set (SUB_ENV_NAME "env.${SCRIPT_EXT}")
|
||||
set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}")
|
||||
|
@@ -2,28 +2,19 @@
|
||||
|
||||
# execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
|
||||
|
||||
# delete obsolete 3RDPARTY_BISON_EXECUTABLE cache variable (not used anymore)
|
||||
unset (3RDPARTY_BISON_EXECUTABLE CACHE)
|
||||
|
||||
# delete BISON_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
|
||||
# without reasonable diagnostic
|
||||
if (NOT BISON_EXECUTABLE)
|
||||
unset (BISON_EXECUTABLE CACHE)
|
||||
if (NOT DEFINED 3RDPARTY_BISON_EXECUTABLE)
|
||||
set (3RDPARTY_BISON_EXECUTABLE "" CACHE FILEPATH "The path to the bison command")
|
||||
endif()
|
||||
|
||||
# Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make
|
||||
# these paths searhed by find_package
|
||||
if (3RDPARTY_DIR)
|
||||
file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/")
|
||||
foreach (candidate_path ${BISON_PATHS})
|
||||
if (IS_DIRECTORY ${candidate_path})
|
||||
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
find_package (BISON 2.7)
|
||||
# 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)
|
||||
|
||||
if (NOT BISON_FOUND OR NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED BISON_EXECUTABLE)
|
||||
find_package (BISON)
|
||||
|
||||
if (BISON_FOUND)
|
||||
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_BISON_EXECUTABLE OR NOT EXISTS "${3RDPARTY_BISON_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_BISON_EXECUTABLE)
|
||||
endif()
|
@@ -2,28 +2,19 @@
|
||||
|
||||
# execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro
|
||||
|
||||
# delete obsolete 3RDPARTY_FLEX_EXECUTABLE cache variable (not used anymore)
|
||||
unset (3RDPARTY_FLEX_EXECUTABLE CACHE)
|
||||
|
||||
# delete FLEX_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
|
||||
# without reasonable diagnostic
|
||||
if (NOT FLEX_EXECUTABLE)
|
||||
unset (FLEX_EXECUTABLE CACHE)
|
||||
if (NOT DEFINED 3RDPARTY_FLEX_EXECUTABLE)
|
||||
set (3RDPARTY_FLEX_EXECUTABLE "" CACHE FILEPATH "The Path to the flex command")
|
||||
endif()
|
||||
|
||||
# Add paths to 3rdparty subfolders containing name "flex" to CMAKE_PROGRAM_PATH variable to make
|
||||
# these paths searhed by find_package
|
||||
if (3RDPARTY_DIR)
|
||||
file (GLOB FLEX_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*flex*")
|
||||
foreach (candidate_path ${FLEX_PATHS})
|
||||
if (IS_DIRECTORY ${candidate_path})
|
||||
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
find_package (FLEX 2.5.3)
|
||||
# FLEX_EXECUTABLE is required by FLEX_TARGET macro and should be defined
|
||||
set (FLEX_EXECUTABLE "${3RDPARTY_FLEX_EXECUTABLE}" CACHE FILEPATH "path to the flex executable" FORCE)
|
||||
|
||||
if (NOT FLEX_FOUND OR NOT FLEX_EXECUTABLE OR NOT EXISTS "${FLEX_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_EXECUTABLE)
|
||||
find_package (FLEX)
|
||||
|
||||
if (FLEX_FOUND)
|
||||
set (3RDPARTY_FLEX_EXECUTABLE "${FLEX_EXECUTABLE}" CACHE FILEPATH "The Path to the flex command" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_FLEX_EXECUTABLE OR NOT EXISTS "${3RDPARTY_FLEX_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FLEX_EXECUTABLE)
|
||||
endif()
|
@@ -123,6 +123,16 @@ if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
elseif(MINGW)
|
||||
# Set default release optimization option to O2 instead of O3, since in
|
||||
# some OCCT related examples, this gives significantly smaller binaries
|
||||
# at comparable performace with MinGW-w64.
|
||||
string (REGEX MATCH "-O3" IS_O3_CXX "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
if (IS_O3_CXX)
|
||||
string (REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
else()
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
endif()
|
||||
|
||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
# workaround bugs in mingw with vtable export
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
|
||||
|
@@ -93,8 +93,8 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
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}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l")
|
||||
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
|
||||
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${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}/${RELATIVE_SOURCES_DIR}/${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})
|
||||
@@ -323,7 +323,7 @@ endif()
|
||||
|
||||
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
|
||||
# Add VTK_OPENGL2_BACKEND definition.
|
||||
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
|
||||
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
|
||||
add_definitions(-DVTK_OPENGL2_BACKEND)
|
||||
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
|
||||
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
|
||||
@@ -346,10 +346,10 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.0.0")
|
||||
# Declare the dependencies public so that all code that uses this library automatically also links with the dependencies
|
||||
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
elseif (BUILD_SHARED_LIBS)
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
|
||||
|
@@ -66,15 +66,10 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
||||
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
|
||||
endif()
|
||||
|
||||
unset (IS_VTK_9XX)
|
||||
if (VTK_FOUND)
|
||||
message ("VTK version (${VTK_VERSION})")
|
||||
if(VTK_MAJOR_VERSION EQUAL 8 AND VTK_MINOR_VERSION GREATER 9 OR VTK_MAJOR_VERSION GREATER 8)
|
||||
set (IS_VTK_9XX 1)
|
||||
else()
|
||||
# add compiler flags, preprocessor definitions, include and link dirs
|
||||
include (${VTK_USE_FILE})
|
||||
endif()
|
||||
|
||||
# add compiler flags, preprocessor definitions, include and link dirs
|
||||
include (${VTK_USE_FILE})
|
||||
|
||||
if (VTK_LIBRARIES)
|
||||
|
||||
@@ -86,83 +81,79 @@ if (VTK_FOUND)
|
||||
# endif()
|
||||
|
||||
foreach (VTK_LIBRARY ${VTK_LIBRARIES})
|
||||
if (IS_VTK_9XX)
|
||||
string (REGEX MATCH "^VTK::" IS_VTK_LIBRARY ${VTK_LIBRARY})
|
||||
else()
|
||||
string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
|
||||
endif()
|
||||
if (NOT IS_VTK_LIBRARY OR NOT TARGET ${VTK_LIBRARY})
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# get paths from corresponding variables
|
||||
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
||||
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
if (NOT WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
|
||||
if (IS_VTK_LIBRARY AND TARGET ${VTK_LIBRARY})
|
||||
# get paths from corresponding variables
|
||||
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# get paths from corresponding properties
|
||||
get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} 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()
|
||||
|
||||
# Work-around against link failure in case if VTK contains dependency
|
||||
# on DirectX: its run-time is always present on Windows, but SDK can
|
||||
# be absent on current workstation, while not actually needed for
|
||||
# OCCT linking.
|
||||
# VTK 6.1 for VC 10
|
||||
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
|
||||
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
|
||||
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (HARDCODED_D3D9_LIB)
|
||||
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
|
||||
|
||||
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
|
||||
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
# VTK 6.1 for VC 12, 14
|
||||
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
|
||||
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
|
||||
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (HARDCODED_D3D9_LIB)
|
||||
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
|
||||
|
||||
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
|
||||
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
if (NOT WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} 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 paths from corresponding properties
|
||||
get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
|
||||
|
||||
get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} 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 (TARGET_VTK_IMPORT_CONFS)
|
||||
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
# todo: choose configuration in connection with the build type
|
||||
#if (CMAKE_BUILD_TYPE)
|
||||
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
|
||||
# endforeach()
|
||||
#endif()
|
||||
|
||||
# Work-around against link failure in case if VTK contains dependency
|
||||
# on DirectX: its run-time is always present on Windows, but SDK can
|
||||
# be absent on current workstation, while not actually needed for
|
||||
# OCCT linking.
|
||||
# VTK 6.1 for VC 10
|
||||
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
|
||||
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
|
||||
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (HARDCODED_D3D9_LIB)
|
||||
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
|
||||
|
||||
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
|
||||
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
# VTK 6.1 for VC 12, 14
|
||||
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
|
||||
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
|
||||
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
if (HARDCODED_D3D9_LIB)
|
||||
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
|
||||
|
||||
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
|
||||
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} 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_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} 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()
|
||||
endif()
|
||||
@@ -196,7 +187,6 @@ if (VTK_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
# endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
|
||||
|
2
adm/scripts/.gitignore
vendored
2
adm/scripts/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
*custom.bat
|
||||
*custom.sh
|
@@ -1,234 +0,0 @@
|
||||
@echo OFF
|
||||
|
||||
rem Auxiliary script for semi-automated building of OCCT for Android platform.
|
||||
rem android_custom.bat should be configured with paths
|
||||
rem to CMake, 3rd-parties, Android NDK and MinGW make tool.
|
||||
|
||||
set "aCasSrc=%~dp0..\.."
|
||||
set "aBuildRoot=%aCasSrc%\work"
|
||||
|
||||
set aNbJobs=%NUMBER_OF_PROCESSORS%
|
||||
|
||||
rem Paths to 3rd-party tools and libraries
|
||||
set "anNdkPath="
|
||||
set "aFreeType="
|
||||
set "aRapidJson="
|
||||
|
||||
rem Build stages to perform
|
||||
set "toCMake=1"
|
||||
set "toClean=0"
|
||||
set "toMake=1"
|
||||
set "toInstall=1"
|
||||
set "toPack=1"
|
||||
set "isStatic=0"
|
||||
|
||||
rem Minimal Android platform and CPU architectures
|
||||
set "anNdkApiLevel=21"
|
||||
set "anNdkAbiList=armeabi-v7a x86 arm64-v8a x86_64"
|
||||
|
||||
rem OCCT Modules to build
|
||||
set "BUILD_ModelingData=ON"
|
||||
set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
set USE_RAPIDJSON=OFF
|
||||
|
||||
rem Archive tool
|
||||
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
|
||||
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
|
||||
|
||||
rem Configuration file
|
||||
if exist "%~dp0android_custom.bat" call "%~dp0android_custom.bat"
|
||||
|
||||
set "aCompiler=gcc"
|
||||
set "aCppLib=gnustl_shared"
|
||||
if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
|
||||
if exist "%anNdkPath%/sources/cxx-stl/llvm-libc++" (
|
||||
set "aCompiler=clang"
|
||||
set "aCppLib=c++_shared"
|
||||
)
|
||||
)
|
||||
set "aLibType=Shared"
|
||||
if ["%isStatic%"] == ["1"] set "aLibType=Static"
|
||||
set "aDestDir=%aBuildRoot%\android-%aCompiler%"
|
||||
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
|
||||
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
||||
|
||||
for %%s in (%anNdkAbiList%) do (
|
||||
call :cmakeGenerate "%anNdkApiLevel%" "%%s"
|
||||
)
|
||||
|
||||
for /F "skip=1 delims=" %%F in ('
|
||||
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
|
||||
') do (
|
||||
for /F "tokens=1-3" %%L in ("%%F") do (
|
||||
set DAY00=0%%L
|
||||
set MONTH00=0%%M
|
||||
set YEAR=%%N
|
||||
)
|
||||
)
|
||||
set DAY00=%DAY00:~-2%
|
||||
set MONTH00=%MONTH00:~-2%
|
||||
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
|
||||
rem set "aRevision=-%aGitBranch%"
|
||||
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-android"
|
||||
set "aTarget=%aBuildRoot%\%anArchName%"
|
||||
if ["%toPack%"] == ["1"] (
|
||||
echo Creating archive %anArchName%.7z
|
||||
rmdir /S /Q "%aTarget%"
|
||||
if not exist "%aTarget%" ( mkdir "%aTarget%" )
|
||||
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
|
||||
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
|
||||
|
||||
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
|
||||
)
|
||||
if not ["%1"] == ["-nopause"] (
|
||||
pause
|
||||
)
|
||||
|
||||
goto :eof
|
||||
|
||||
:cmakeGenerate
|
||||
set "anApi=%~1"
|
||||
set "anAbi=%~2"
|
||||
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
|
||||
set "aWorkDir=%aBuildRoot%\%aPlatformAndCompiler%-make"
|
||||
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
|
||||
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
|
||||
if exist "%aLogFile%" ( del "%aLogFile%" )
|
||||
|
||||
rem include some information about OCCT into archive
|
||||
echo ^<pre^>> "%aWorkDir%\VERSION.html"
|
||||
git status >> "%aWorkDir%\VERSION.html"
|
||||
git log -n 100 >> "%aWorkDir%\VERSION.html"
|
||||
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
|
||||
|
||||
echo Start building OCCT for %aPlatformAndCompiler%
|
||||
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
|
||||
|
||||
pushd "%aWorkDir%"
|
||||
|
||||
set "aTimeZERO=%TIME%"
|
||||
if ["%toCMake%"] == ["1"] (
|
||||
echo Configuring OCCT for Android %anAbi%, API level %anApi%...
|
||||
cmake -G "MinGW Makefiles" ^
|
||||
-D CMAKE_SYSTEM_NAME:STRING="Android" ^
|
||||
-D CMAKE_ANDROID_NDK="%anNdkPath%" ^
|
||||
-D CMAKE_BUILD_TYPE:STRING="Release" ^
|
||||
-D CMAKE_ANDROID_ARCH_ABI:STRING="%anAbi%" ^
|
||||
-D CMAKE_SYSTEM_VERSION:STRING="%anApi%" ^
|
||||
-D CMAKE_ANDROID_STL_TYPE="%aCppLib%" ^
|
||||
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
|
||||
-D INSTALL_DIR:PATH="%aDestDir%" ^
|
||||
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
|
||||
-D INSTALL_DIR_LIB:STRING="libs/%anAbi%" ^
|
||||
-D INSTALL_DIR_CMAKE:STRING="libs/%anAbi%/cmake/opencascade" ^
|
||||
-D INSTALL_DIR_RESOURCE:STRING="src" ^
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
|
||||
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" ^
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" ^
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
|
||||
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/libs/%anAbi%" ^
|
||||
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/libfreetype.so" ^
|
||||
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
|
||||
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
|
||||
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
|
||||
"%aCasSrc%"
|
||||
|
||||
if errorlevel 1 (
|
||||
popd
|
||||
exit /B 1
|
||||
goto :eof
|
||||
)
|
||||
)
|
||||
set aTimeGEN=%TIME%
|
||||
call :computeDuration %aTimeZERO% %aTimeGEN%
|
||||
if ["%toCMake%"] == ["1"] (
|
||||
echo Generation time: %DURATION%
|
||||
echo Generation time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
if ["%toClean%"] == ["1"] (
|
||||
mingw32-make clean
|
||||
)
|
||||
|
||||
if ["%toMake%"] == ["1"] (
|
||||
echo Building...
|
||||
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
|
||||
if errorlevel 1 (
|
||||
type "%aLogFile%"
|
||||
popd
|
||||
exit /B 1
|
||||
goto :eof
|
||||
)
|
||||
type "%aLogFile%"
|
||||
)
|
||||
set aTimeBUILD=%TIME%
|
||||
call :computeDuration %aTimeGEN% %aTimeBUILD%
|
||||
if ["%toMake%"] == ["1"] (
|
||||
echo Building time: %DURATION%
|
||||
echo Building time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
call :computeDuration %aTimeZERO% %aTimeBUILD%
|
||||
if ["%toMake%"] == ["1"] (
|
||||
echo Total building time: %DURATION%
|
||||
echo Total building time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
if ["%toInstall%"] == ["1"] (
|
||||
echo Installing into %aDestDir%...
|
||||
mingw32-make install 2>> "%aLogFile%"
|
||||
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
|
||||
)
|
||||
set "aTimeINSTALL=%TIME%"
|
||||
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
|
||||
if ["%toInstall%"] == ["1"] (
|
||||
echo Install time: %DURATION%
|
||||
echo Install time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
|
||||
echo Total time: %DURATION%
|
||||
echo Total time: %DURATION%>> "%aLogFile%"
|
||||
|
||||
popd
|
||||
goto :eof
|
||||
|
||||
:computeDuration
|
||||
set "aTimeFrom=%~1"
|
||||
set "aTimeEnd=%~2"
|
||||
rem handle time before 10AM (win10 - remove empty space at the beginning)
|
||||
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
|
||||
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
|
||||
rem handle time before 10AM (win7 - add 0 at the beginning)
|
||||
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
|
||||
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
|
||||
rem convert hours:minutes:seconds:ms into duration
|
||||
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
|
||||
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
|
||||
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
|
||||
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
|
||||
set /A aDurHH=%aDurTotalSec% / 360000
|
||||
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
|
||||
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
|
||||
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
|
||||
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
|
||||
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
|
||||
|
||||
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
|
||||
goto :eof
|
@@ -1,31 +0,0 @@
|
||||
rem Environment configuration template for android_build.bat (to be renamed as android_custom.bat)
|
||||
|
||||
rem Paths to 3rd-party tools and libraries
|
||||
rem call c:\TDM-GCC-64\mingwvars.bat
|
||||
rem set "PATH=c:\CMake\bin;%PATH%"
|
||||
rem set "anNdkPath=c:/android-ndk-r12"
|
||||
rem set "aFreeType=c:/freetype-2.7.1-android"
|
||||
rem set "aRapidJson=c:/rapidjson-1.1.0"
|
||||
|
||||
rem Uncomment to customize building steps
|
||||
rem set "aBuildRoot=%~dp0..\..\work"
|
||||
rem set "toCMake=1"
|
||||
rem set "toClean=0"
|
||||
rem set "toMake=1"
|
||||
rem set "toInstall=1"
|
||||
rem set "toPack=1"
|
||||
rem set "isStatic=0"
|
||||
|
||||
rem Minimal Android platform and CPU architectures
|
||||
rem set "anNdkApiLevel=21"
|
||||
rem set "anNdkAbiList=arm64-v8a x86_64"
|
||||
|
||||
rem OCCT Modules to build
|
||||
rem set "BUILD_ModelingData=ON"
|
||||
rem set "BUILD_ModelingAlgorithms=ON"
|
||||
rem set "BUILD_Visualization=ON"
|
||||
rem set "BUILD_ApplicationFramework=ON"
|
||||
rem set "BUILD_DataExchange=ON"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
rem set USE_RAPIDJSON=ON
|
@@ -1,46 +0,0 @@
|
||||
rem Environment configuration template for cmake_gen.bat (to be renamed as cmake_gen_custom.bat)
|
||||
|
||||
set "OCCT3RDPARTY=%SrcRoot%\..\3rdparty"
|
||||
|
||||
set VS=14
|
||||
set VSDATA=2015
|
||||
|
||||
rem Leave VSPLATFORM empty to build for x86 platform
|
||||
set VSPLATFORM=Win64
|
||||
|
||||
rem ------------------------------------
|
||||
rem Uncomment to customize building steps
|
||||
rem ------------------------------------
|
||||
|
||||
rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
|
||||
rem set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
rem set BUILD_DOC_Overview=OFF
|
||||
rem set BUILD_Inspector=OFF
|
||||
rem set BUILD_LIBRARY_TYPE=Shared
|
||||
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
rem set BUILD_WITH_DEBUG=OFF
|
||||
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
rem set BUILD_USE_PCH=OFF
|
||||
|
||||
rem Use semicolon-separated list of toolkits if you want to disable all modules
|
||||
rem and build only some toolkits.
|
||||
rem set BUILD_ADDITIONAL_TOOLKITS=
|
||||
|
||||
rem Set a directory recognized as a patch for OCCT.
|
||||
rem set BUILD_PATCH=
|
||||
|
||||
rem set BUILD_MODULE_ApplicationFramework=ON
|
||||
rem set BUILD_MODULE_DataExchange=ON
|
||||
rem set BUILD_MODULE_Draw=ON
|
||||
rem set BUILD_MODULE_ModelingAlgorithms=ON
|
||||
rem set BUILD_MODULE_ModelingData=ON
|
||||
rem set BUILD_MODULE_Visualization=ON
|
||||
|
||||
rem set USE_D3D=OFF
|
||||
rem set USE_FFMPEG=OFF
|
||||
rem set USE_FREEIMAGE=OFF
|
||||
rem set USE_GLES2=OFF
|
||||
rem set USE_RAPIDJSON=OFF
|
||||
rem set USE_TBB=OFF
|
||||
rem set USE_VTK=OFF
|
@@ -1,42 +0,0 @@
|
||||
# Environment configuration template for cmake_gen.sh (to be renamed as cmake_gen_custom.sh)
|
||||
|
||||
OCCT3RDPARTY="$SrcRoot/../3rdparty"
|
||||
FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
|
||||
|
||||
# ------------------------------------
|
||||
# Uncomment to customize building steps
|
||||
# ------------------------------------
|
||||
|
||||
#BUILD_DIR=build
|
||||
#INSTALL_DIR="$SrcRoot/install"
|
||||
|
||||
#BUILD_DOC_Overview=OFF
|
||||
#BUILD_Inspector=OFF
|
||||
#BUILD_LIBRARY_TYPE=Shared
|
||||
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
#BUILD_WITH_DEBUG=OFF
|
||||
#BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
|
||||
# Use semicolon-separated list of toolkits if you want to disable all modules
|
||||
# and build only some toolkits.
|
||||
#BUILD_ADDITIONAL_TOOLKITS=
|
||||
|
||||
# Set a directory recognized as a patch for OCCT.
|
||||
#BUILD_PATCH=
|
||||
|
||||
#BUILD_MODULE_ApplicationFramework=ON
|
||||
#BUILD_MODULE_DataExchange=ON
|
||||
#BUILD_MODULE_Draw=ON
|
||||
#BUILD_MODULE_ModelingAlgorithms=ON
|
||||
#BUILD_MODULE_ModelingData=ON
|
||||
#BUILD_MODULE_Visualization=ON
|
||||
|
||||
#USE_FFMPEG=OFF
|
||||
#USE_FREEIMAGE=OFF
|
||||
#USE_GLES2=OFF
|
||||
#USE_RAPIDJSON=OFF
|
||||
#USE_TBB=OFF
|
||||
#USE_VTK=OFF
|
||||
|
||||
# This is to add any additional arguments to cmake
|
||||
#AUX_ARGS=
|
@@ -1,83 +0,0 @@
|
||||
@echo off
|
||||
|
||||
rem Auxiliary script for semi-automated building of OCCT using cmake.
|
||||
rem cmake_custom.bat should be configured with VS version and path to 3rd-parties.
|
||||
rem OCCT3RDPARTY must be specified as mandatory dependency.
|
||||
|
||||
setlocal
|
||||
|
||||
set "SrcRoot=%~dp0..\.."
|
||||
|
||||
set VS=14
|
||||
set VSDATA=2015
|
||||
set VSPLATFORM=Win64
|
||||
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
|
||||
set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
set BUILD_ADDITIONAL_TOOLKITS=
|
||||
set BUILD_DOC_Overview=OFF
|
||||
set BUILD_Inspector=OFF
|
||||
set BUILD_LIBRARY_TYPE=Shared
|
||||
set BUILD_PATCH=
|
||||
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
set BUILD_WITH_DEBUG=OFF
|
||||
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
set BUILD_USE_PCH=OFF
|
||||
|
||||
set BUILD_MODULE_ApplicationFramework=ON
|
||||
set BUILD_MODULE_DataExchange=ON
|
||||
set BUILD_MODULE_Draw=ON
|
||||
set BUILD_MODULE_ModelingAlgorithms=ON
|
||||
set BUILD_MODULE_ModelingData=ON
|
||||
set BUILD_MODULE_Visualization=ON
|
||||
|
||||
set USE_D3D=OFF
|
||||
set USE_FFMPEG=OFF
|
||||
set USE_FREEIMAGE=OFF
|
||||
set USE_GLES2=OFF
|
||||
set USE_RAPIDJSON=OFF
|
||||
set USE_TBB=OFF
|
||||
set USE_VTK=OFF
|
||||
|
||||
if exist "%~dp0cmake_custom.bat" call "%~dp0cmake_custom.bat"
|
||||
|
||||
if not "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA% %VSPLATFORM%"
|
||||
if "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA%"
|
||||
|
||||
set "INSTALL_DIR=%INSTALL_DIR:\=/%"
|
||||
set "OCCT3RDPARTY=%OCCT3RDPARTY:\=/%"
|
||||
|
||||
set "BUILD_DIR=%SrcRoot%\%BUILD_DIR%"
|
||||
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
|
||||
pushd "%BUILD_DIR%"
|
||||
|
||||
cmake -G "%arch_compile%" ^
|
||||
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
|
||||
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
|
||||
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
|
||||
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
|
||||
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
|
||||
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
|
||||
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
|
||||
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
|
||||
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
|
||||
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
|
||||
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
|
||||
-D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
|
||||
-D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
|
||||
-D USE_D3D:BOOL=%USE_D3D% ^
|
||||
-D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
|
||||
-D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
|
||||
-D USE_GLES2:BOOL=%USE_GLES2% ^
|
||||
-D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
|
||||
-D USE_TBB:BOOL=%USE_TBB% ^
|
||||
-D USE_VTK:BOOL=%USE_VTK% ^
|
||||
"%SrcRoot%"
|
||||
|
||||
popd
|
||||
endlocal
|
@@ -1,86 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Auxiliary script for semi-automated building of OCCT using cmake.
|
||||
# cmake_custom.sh should be configured with path to 3rd-parties.
|
||||
# OCCT3RDPARTY and FREETYPE_DIR must be specified as mandatory dependencies.
|
||||
|
||||
ScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
SrcRoot="${ScriptDir}/../.."
|
||||
|
||||
INSTALL_DIR="$SrcRoot/install"
|
||||
|
||||
BUILD_DIR=build
|
||||
DEB=
|
||||
CMAKE_BUILD_TYPE=Release
|
||||
if [ "$1" = "-d" ]; then
|
||||
DEB=d
|
||||
BUILD_DIR=${BUILD_DIR}-deb
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
fi
|
||||
INSTALL_DIR_BIN=lin64/gcc/bin$DEB
|
||||
INSTALL_DIR_LIB=lin64/gcc/lib$DEB
|
||||
|
||||
BUILD_ADDITIONAL_TOOLKITS=
|
||||
BUILD_DOC_Overview=OFF
|
||||
BUILD_Inspector=OFF
|
||||
BUILD_LIBRARY_TYPE=Shared
|
||||
BUILD_PATCH=
|
||||
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
BUILD_WITH_DEBUG=OFF
|
||||
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
|
||||
BUILD_MODULE_ApplicationFramework=ON
|
||||
BUILD_MODULE_DataExchange=ON
|
||||
BUILD_MODULE_Draw=ON
|
||||
BUILD_MODULE_ModelingAlgorithms=ON
|
||||
BUILD_MODULE_ModelingData=ON
|
||||
BUILD_MODULE_Visualization=ON
|
||||
|
||||
USE_FFMPEG=OFF
|
||||
USE_FREEIMAGE=OFF
|
||||
USE_GLES2=OFF
|
||||
USE_RAPIDJSON=OFF
|
||||
USE_TBB=OFF
|
||||
USE_VTK=OFF
|
||||
AUX_ARGS=
|
||||
|
||||
if [ -f "${ScriptDir}/cmake_custom.sh" ]; then
|
||||
. "${ScriptDir}/cmake_custom.sh"
|
||||
fi
|
||||
|
||||
BUILD_DIR="$SrcRoot/$BUILD_DIR"
|
||||
if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
|
||||
pushd "$BUILD_DIR"
|
||||
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
|
||||
-D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
|
||||
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
|
||||
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
|
||||
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
|
||||
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
|
||||
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
|
||||
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
|
||||
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
|
||||
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
|
||||
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
|
||||
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
|
||||
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \
|
||||
-D INSTALL_DIR:PATH="$INSTALL_DIR" \
|
||||
-D INSTALL_DIR_LAYOUT:STRING=Windows \
|
||||
-D INSTALL_DIR_BIN:STRING=$INSTALL_DIR_BIN \
|
||||
-D INSTALL_DIR_LIB:STRING=$INSTALL_DIR_LIB \
|
||||
-D USE_FFMPEG:BOOL=$USE_FFMPEG \
|
||||
-D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \
|
||||
-D USE_GLES2:BOOL=$USE_GLES2 \
|
||||
-D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \
|
||||
-D USE_TBB:BOOL=$USE_TBB \
|
||||
-D USE_VTK:BOOL=$USE_VTK \
|
||||
$AUX_ARGS "$SrcRoot"
|
||||
|
||||
popd
|
@@ -1,165 +0,0 @@
|
||||
@echo OFF
|
||||
|
||||
rem Auxiliary script for semi-automated building of OCCT for WASM platform.
|
||||
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
|
||||
rem FreeType should be specified as mandatory dependency.
|
||||
|
||||
set "aSrcRoot=%~dp0..\.."
|
||||
set "aBuildRoot=work"
|
||||
|
||||
set aNbJobs=%NUMBER_OF_PROCESSORS%
|
||||
|
||||
set "toCMake=1"
|
||||
set "toClean=0"
|
||||
set "toMake=1"
|
||||
set "toInstall=1"
|
||||
|
||||
set "BUILD_ModelingData=ON"
|
||||
set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
|
||||
rem Configuration file
|
||||
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
|
||||
|
||||
call "%EMSDK_ROOT%\emsdk_env.bat"
|
||||
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
||||
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
|
||||
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
||||
|
||||
call :cmakeGenerate
|
||||
if not ["%1"] == ["-nopause"] (
|
||||
pause
|
||||
)
|
||||
|
||||
goto :eof
|
||||
|
||||
:cmakeGenerate
|
||||
set "aPlatformAndCompiler=wasm"
|
||||
set "aWorkDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%-make"
|
||||
set "aDestDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%"
|
||||
set "aLogFile=%aSrcRoot%\%aBuildRoot%\build-%aPlatformAndCompiler%.log"
|
||||
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
|
||||
if exist "%aLogFile%" ( del "%aLogFile%" )
|
||||
|
||||
rem include some information about OCCT into archive
|
||||
echo ^<pre^>> "%aWorkDir%\VERSION.html"
|
||||
git status >> "%aWorkDir%\VERSION.html"
|
||||
git log -n 100 >> "%aWorkDir%\VERSION.html"
|
||||
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
|
||||
|
||||
echo Start building OCCT for %aPlatformAndCompiler%
|
||||
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
|
||||
|
||||
pushd "%aWorkDir%"
|
||||
|
||||
set aTimeZERO=%TIME%
|
||||
if ["%toCMake%"] == ["1"] (
|
||||
echo "Configuring OCCT for WASM..."
|
||||
cmake -G "MinGW Makefiles" ^
|
||||
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
||||
-D CMAKE_BUILD_TYPE:STRING="Release" ^
|
||||
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
|
||||
-D INSTALL_DIR:PATH="%aDestDir%" ^
|
||||
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
|
||||
-D INSTALL_DIR_RESOURCE:STRING="src" ^
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
|
||||
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" ^
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" ^
|
||||
"%aSrcRoot%"
|
||||
|
||||
if errorlevel 1 (
|
||||
popd
|
||||
exit /B 1
|
||||
goto :eof
|
||||
)
|
||||
)
|
||||
set aTimeGEN=%TIME%
|
||||
call :computeDuration %aTimeZERO% %aTimeGEN%
|
||||
if ["%toCMake%"] == ["1"] (
|
||||
echo Generation time: %DURATION%
|
||||
echo Generation time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
if "%toClean%"=="1" (
|
||||
mingw32-make clean
|
||||
)
|
||||
|
||||
if "%toMake%"=="1" (
|
||||
echo Building...
|
||||
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
|
||||
if errorlevel 1 (
|
||||
popd
|
||||
exit /B 1
|
||||
goto :eof
|
||||
)
|
||||
type "%aLogFile%"
|
||||
)
|
||||
set aTimeBUILD=%TIME%
|
||||
call :computeDuration %aTimeGEN% %aTimeBUILD%
|
||||
if "%toMake%"=="1" (
|
||||
echo Building time: %DURATION%
|
||||
echo Building time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
call :computeDuration %aTimeZERO% %aTimeBUILD%
|
||||
if "%toMake%"=="1" (
|
||||
echo Total building time: %DURATION%
|
||||
echo Total building time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
if "%toInstall%"=="1" (
|
||||
echo Installing into %aDestDir%...
|
||||
mingw32-make install 2>> "%aLogFile%"
|
||||
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
|
||||
)
|
||||
set aTimeINSTALL=%TIME%
|
||||
call :computeDuration %aTimeBUILD% %aTimeINSTALL%
|
||||
if "%toInstall%"=="1" (
|
||||
echo Install time: %DURATION%
|
||||
echo Install time: %DURATION%>> "%aLogFile%"
|
||||
)
|
||||
|
||||
call :computeDuration %aTimeZERO% %aTimeINSTALL%
|
||||
echo Total time: %DURATION%
|
||||
echo Total time: %DURATION%>> "%aLogFile%"
|
||||
|
||||
popd
|
||||
goto :eof
|
||||
|
||||
:computeDuration
|
||||
set aTimeFrom=%1
|
||||
set aTimeEnd=%2
|
||||
rem handle time before 10AM (win10 - remove empty space at the beginning)
|
||||
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
|
||||
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
|
||||
rem handle time before 10AM (win7 - add 0 at the beginning)
|
||||
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
|
||||
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
|
||||
rem convert hours:minutes:seconds:ms into duration
|
||||
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
|
||||
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
|
||||
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
|
||||
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
|
||||
set /A aDurHH=%aDurTotalSec% / 360000
|
||||
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
|
||||
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
|
||||
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
|
||||
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
|
||||
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
|
||||
|
||||
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
|
||||
goto :eof
|
@@ -1,126 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Auxiliary script for semi-automated building of OCCT for WASM platform.
|
||||
# wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
|
||||
# FreeType should be specified as mandatory dependency.
|
||||
|
||||
export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
export aSrcRoot="${aScriptDir}/../.."
|
||||
export aBuildRoot=work
|
||||
|
||||
export aNbJobs=${NUMBER_OF_PROCESSORS}
|
||||
|
||||
export toCMake=1
|
||||
export toClean=0
|
||||
export toMake=1
|
||||
export toInstall=1
|
||||
|
||||
export BUILD_ModelingData=ON
|
||||
export BUILD_ModelingAlgorithms=ON
|
||||
export BUILD_Visualization=ON
|
||||
export BUILD_ApplicationFramework=ON
|
||||
export BUILD_DataExchange=ON
|
||||
|
||||
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
|
||||
. "${aScriptDir}/wasm_custom.sh"
|
||||
fi
|
||||
|
||||
. "${EMSDK_ROOT}/emsdk_env.sh"
|
||||
|
||||
export aToolchain="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
||||
|
||||
export aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
echo "Compilation OCCT branch : $aGitBranch"
|
||||
|
||||
export aPlatformAndCompiler=wasm
|
||||
|
||||
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
|
||||
if [ ! -d "${aWorkDir}" ]; then
|
||||
mkdir -p "${aWorkDir}"
|
||||
fi
|
||||
|
||||
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
|
||||
if [ ! -d "${aDestDir}" ]; then
|
||||
mkdir -p "${aDestDir}"
|
||||
fi
|
||||
|
||||
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
|
||||
if [ -f "${aLogFile}" ]; then
|
||||
rm "${aLogFile}"
|
||||
fi
|
||||
|
||||
echo Start building OCCT for ${aPlatformAndCompiler}
|
||||
echo Start building OCCT for ${aPlatformAndCompiler}>> "${aLogFile}"
|
||||
|
||||
pushd "${aWorkDir}"
|
||||
pwd
|
||||
echo toCMake=${toCMake}
|
||||
if [ "${toCMake}" = "1" ]; then
|
||||
|
||||
echo "Configuring OCCT for WASM..."
|
||||
echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DBUILD_LIBRARY_TYPE:STRING="Static" \
|
||||
-DINSTALL_DIR:PATH="${aDestDir}" \
|
||||
-DINSTALL_DIR_INCLUDE:STRING="inc" \
|
||||
-DINSTALL_DIR_RESOURCE:STRING="src" \
|
||||
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
|
||||
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
|
||||
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
|
||||
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
|
||||
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
|
||||
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
|
||||
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-DBUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
|
||||
|
||||
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DBUILD_LIBRARY_TYPE:STRING="Static" \
|
||||
-DINSTALL_DIR:PATH="${aDestDir}" \
|
||||
-DINSTALL_DIR_INCLUDE:STRING="inc" \
|
||||
-DINSTALL_DIR_RESOURCE:STRING="src" \
|
||||
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
|
||||
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
|
||||
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
|
||||
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
|
||||
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
|
||||
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
|
||||
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-DBUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Problem during configuration"
|
||||
popd
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ "${toClean}" = "1" ]; then
|
||||
make clean
|
||||
fi
|
||||
|
||||
if [ "${toMake}" = "1" ]; then
|
||||
echo Building...
|
||||
make -j ${aNbJobs} 2>> "${aLogFile}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Problem during make operation"
|
||||
popd
|
||||
exit 1
|
||||
fi
|
||||
echo "${aLogFile}"
|
||||
fi
|
||||
|
||||
if [ "${toInstall}" = "1" ]; then
|
||||
echo Installing into ${aDestDir}
|
||||
make install 2>> "${aLogFile}"
|
||||
fi
|
||||
|
||||
popd
|
@@ -1,16 +0,0 @@
|
||||
rem Environment configuration template for occ_build_wasm.bat (to be renamed as wasm_custom_env.bat)
|
||||
set "aFreeType=%aSrcRoot%\..\3rdparty\freetype-2.7.1-wasm"
|
||||
set "EMSDK_ROOT=%aSrcRoot%\..\emsdk"
|
||||
|
||||
rem Uncomment to customize building steps
|
||||
rem set "aBuildRoot=work"
|
||||
rem set "toCMake=1"
|
||||
rem set "toClean=0"
|
||||
rem set "toMake=1"
|
||||
rem set "toInstall=1"
|
||||
|
||||
rem set "BUILD_ModelingData=ON"
|
||||
rem set "BUILD_ModelingAlgorithms=ON"
|
||||
rem set "BUILD_Visualization=ON"
|
||||
rem set "BUILD_ApplicationFramework=ON"
|
||||
rem set "BUILD_DataExchange=ON"
|
@@ -1,16 +0,0 @@
|
||||
# environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
|
||||
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
|
||||
export EMSDK_ROOT="$aSrcRoot/../emsdk"
|
||||
|
||||
# Uncomment to customize building steps
|
||||
#export aBuildRoot=work
|
||||
#export toCMake=1
|
||||
#export toClean=0
|
||||
#export toMake=1
|
||||
#export toInstall=1
|
||||
|
||||
#export BUILD_ModelingData=ON
|
||||
#export BUILD_ModelingAlgorithms=ON
|
||||
#export BUILD_Visualization=ON
|
||||
#export BUILD_ApplicationFramework=ON
|
||||
#export BUILD_DataExchange=ON
|
@@ -21,7 +21,6 @@ set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
|
||||
# This is made to support different locations of CMake files:
|
||||
# - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version>
|
||||
# - in Windows style: $INSTALL_DIR/cmake
|
||||
# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade-<version>
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
|
||||
@@ -30,10 +29,6 @@ endif()
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
endif()
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
endif()
|
||||
|
||||
# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
|
||||
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")
|
||||
|
@@ -1,38 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem Setup environment
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
rem Define path to project file
|
||||
set "PRJFILE=%~dp0OCCT.sln"
|
||||
|
||||
if "%VCVER%" == "vc8" (
|
||||
call "%VS80COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc9" (
|
||||
call "%VS90COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc10" (
|
||||
call "%VS100COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc11" (
|
||||
call "%VS110COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc12" (
|
||||
call "%VS120COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc14" (
|
||||
call "%VS140COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc141" (
|
||||
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc142" (
|
||||
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else (
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
)
|
||||
|
||||
set BUILDCONFIG=Release
|
||||
if "%CASDEB%"=="i" set BUILDCONFIG=RelWithDebInfo
|
||||
if "%CASDEB%"=="d" set BUILDCONFIG=Debug
|
||||
if "%ARCH%"=="32" set PLATFORM=win32
|
||||
if "%ARCH%"=="64" set PLATFORM=x64
|
||||
|
||||
msbuild "%PRJFILE%" /m /fl /flp:LogFile="build_%BUILDCONFIG%.log" /p:Configuration=%BUILDCONFIG% /p:Platform=%PLATFORM% /p:BuildProjectReferences=false
|
||||
endlocal
|
@@ -1,38 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem Setup environment
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
rem Define path to project file
|
||||
set "PRJFILE=%~dp0INSTALL.vcxproj"
|
||||
|
||||
if "%VCVER%" == "vc8" (
|
||||
call "%VS80COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc9" (
|
||||
call "%VS90COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc10" (
|
||||
call "%VS100COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc11" (
|
||||
call "%VS110COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc12" (
|
||||
call "%VS120COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc14" (
|
||||
call "%VS140COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc141" (
|
||||
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else if "%VCVER%" == "vc142" (
|
||||
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
|
||||
) else (
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
)
|
||||
|
||||
set BUILDCONFIG=Release
|
||||
if "%CASDEB%"=="i" set BUILDCONFIG=RelWithDebInfo
|
||||
if "%CASDEB%"=="d" set BUILDCONFIG=Debug
|
||||
if "%ARCH%"=="32" set PLATFORM=win32
|
||||
if "%ARCH%"=="64" set PLATFORM=x64
|
||||
|
||||
msbuild "%PRJFILE%" /m /fl /flp:LogFile="install_%BUILDCONFIG%.log" /p:Configuration=%BUILDCONFIG% /p:Platform=%PLATFORM% /p:BuildProjectReferences=false
|
||||
endlocal
|
@@ -71,7 +71,6 @@ BOPTools::MapShapesAndAncestors TopExp::MapShapesAndAncestors
|
||||
BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
|
||||
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
|
||||
CDM_MessageDriver Message_Messenger
|
||||
Message_ProgressSentry Message_ProgressScope
|
||||
|
||||
[tcollection]
|
||||
AdvApp2Var_SequenceOfNode
|
||||
|
@@ -1935,118 +1935,6 @@ Offset direction, which used in class Adaptor2d_OffsetCurve for evaluating value
|
||||
|
||||
Adaptor2d_OffsetCurve aOC(BaseCurve, Offset) --> Adaptor2d_OffsetCurve aOC(BaseCurve, -Offset)
|
||||
|
||||
subsection upgrade_750_ProgressIndicator Change of Message_ProgressIndicator
|
||||
|
||||
The progress indication mechanism has been revised to eliminate its weak points in previous design (leading to ambiguity and unprotected from an error-prone behavior).
|
||||
Redesign also allows using progress indicator in multi-threaded algorithms in more straight-forward way with minimal overhead.
|
||||
Note, however, that multi-threaded algorithm should pre-allocate per-thread progress scopes in advance to ensure thread-safety - check new classes API for details.
|
||||
|
||||
Classes Message_ProgressSentry and Message_ProgressScale have been removed.
|
||||
New classes Message_ProgressScope and Messge_ProgressRange replace them and should be used as main API classes to organize progress indication in the algorithms.
|
||||
Instances of the class Message_ProgressRange are used to pass the progress capability to nested levels of the algorithm
|
||||
and an instance of the class Message_ProgressScope is to be created (preferably as local variable) to manage progress at each level of the algorithm.
|
||||
The instance of Message_ProgressIndicator is not passed anymore to sub-algorithms.
|
||||
See documentation of the class Message_ProgressScope for more details and examples.
|
||||
|
||||
Methods to deal with progress scopes and to advance progress are removed from class Message_ProgressIndicator; now it only provides interface to the application-level progress indicator.
|
||||
Virtual method Message_ProgressIndicator::Show() has changed its signature and should be updated accordingly in descendants of Message_ProgressIndicator.
|
||||
The scope passed as argument to this method can be used to obtain information on context of the current process (instead of calling method GetScope() in previous implementation).
|
||||
Methods Show(), UserBreak(), and Reset() are made protected in class Message_ProgressIndicator; method More() of Message_ProgressScope should be used to know if the cancel event has come.
|
||||
See documentation of the class Message_ProgressIndicator for more details and implementation of Draw_ProgressIndicator for an example.
|
||||
|
||||
Lets take a look onto typical algorithm using an old API:
|
||||
@code
|
||||
class MyAlgo
|
||||
{
|
||||
public:
|
||||
//! Algorithm entry point taking an optional Progress Indicator.
|
||||
bool Perform (const TCollection_AsciiString& theFileName,
|
||||
const Handle(Message_ProgressIndicator)& theProgress = Handle(Message_ProgressIndicator)())
|
||||
{
|
||||
Message_ProgressSentry aPSentry (theProgress, (TCollection_AsciiString("Processing ") + theFileName).ToCString(), 2);
|
||||
{
|
||||
Message_ProgressSentry aPSentry1 (theProgress, "Stage 1", 0, 153, 1);
|
||||
for (int anIter = 0; anIter < 153; ++anIter, aPSentry1.Next())
|
||||
{ if (!aPSentry1.More()) { return false; } }
|
||||
}
|
||||
aPSentry.Next();
|
||||
{
|
||||
perform2 (theProgress);
|
||||
}
|
||||
aPSentry.Next();
|
||||
bool wasAborted = !theProgress.IsNull() && theProgress->UserBreak();
|
||||
return !wasAborted;
|
||||
}
|
||||
|
||||
private:
|
||||
//! Nested sub-algorithm taking Progress Indicator.
|
||||
bool perform2 (const Handle(Message_ProgressIndicator)& theProgress)
|
||||
{
|
||||
Message_ProgressSentry aPSentry2 (theProgress, "Stage 2", 0, 561, 1);
|
||||
for (int anIter = 0; anIter < 561 && aPSentry2.More(); ++anIter, aPSentry2.Next()) {}
|
||||
return aPSentry2.More();
|
||||
}
|
||||
};
|
||||
|
||||
// application executing an algorithm
|
||||
Handle(Message_ProgressIndicator) aProgress = new MyProgress();
|
||||
MyAlgo anAlgo;
|
||||
anAlgo.Perform ("FileName", aProgress);
|
||||
@endcode
|
||||
|
||||
The following guidance can be used to update such code:
|
||||
- Replace `const Handle(Message_ProgressIndicator)&` with `const Message_ProgressRange&`.
|
||||
Message_ProgressIndicator object should be now created only at place where application starts algorithms.
|
||||
- Replace `Message_ProgressSentry` with `Message_ProgressScope`.
|
||||
Take note that Message_ProgressScope has smaller number of arguments (no "minimal value").
|
||||
In other aspects, Message_ProgressScope mimics an iterator-style interface (with methods More() and Next())
|
||||
close to the old Message_ProgressSentry (pay attention to extra functionality of Message_ProgressScope::Next() method below).
|
||||
- Each Message_ProgressScope should take the next Range to fill in.
|
||||
Within old API, Message_ProgressSentry received the root Progress Indicator object and implicitly split it into ranges using error-prone logic.
|
||||
Message_ProgressScope in new API takes Message_ProgressRange, which should be created from the Range of the parent Scope using value returned by Message_ProgressScope::Next() method.
|
||||
Don't use the same Range passed to the algorithm for all sub-Scopes like it was possible in old API.
|
||||
- Check user abortion state using Message_ProgressScope::UserBreak() method;
|
||||
Message_ProgressRange is a temporary object with the only purpose to create a new Message_ProgressScope,
|
||||
and Message_ProgressIndicator should be never passed directly to algorithms.
|
||||
|
||||
Take a look onto ported code and compare with code above to see differences:
|
||||
|
||||
@code
|
||||
class MyAlgo
|
||||
{
|
||||
public:
|
||||
//! Algorithm entry point taking an optional Progress Range.
|
||||
bool Perform (const TCollection_AsciiString& theFileName,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange())
|
||||
{
|
||||
Message_ProgressScope aPSentry (theProgress, TCollection_AsciiString("Processing ") + theFileName, 2);
|
||||
{
|
||||
Message_ProgressScope aPSentry1 (aPSentry.Next(), "Stage 1", 153);
|
||||
for (int anIter = 0; anIter < 153; ++anIter, aPSentry1.Next())
|
||||
{ if (!aPSentry1.More()) { return false; }; }
|
||||
}
|
||||
{
|
||||
perform2 (aPSentry.Next());
|
||||
}
|
||||
bool wasAborted = aPSentry.UserBreak();
|
||||
return !wasAborted;
|
||||
}
|
||||
|
||||
//! Nested sub-algorithm taking Progress sub-Range.
|
||||
bool perform2 (const Message_ProgressRange& theProgress)
|
||||
{
|
||||
Message_ProgressScope aPSentry2 (theProgress, "Stage 2", 561);
|
||||
for (int anIter = 0; anIter < 561 && aPSentry2.More(); ++anIter, aPSentry2.Next()) {}
|
||||
return aPSentry2.More();
|
||||
}
|
||||
};
|
||||
|
||||
// application executing an algorithm
|
||||
Handle(Message_ProgressIndicator) aProgress = new MyProgress();
|
||||
MyAlgo anAlgo;
|
||||
anAlgo.Perform ("FileName", aProgress->Start());
|
||||
@endcode
|
||||
|
||||
@subsection upgrade_750_message_messenger Message_Messenger interface change
|
||||
|
||||
Operators << with left argument *Handle(Message_Messenger)*, used to output messages with
|
||||
@@ -2092,10 +1980,6 @@ Previously, sub-classes of *Message_Printer* have to provide a triplet of *Messa
|
||||
*Message_Printer* interface has been changed, so that sub-classes now have to implement only single method *Message_Printer::send()* accepting TCollection_AsciiString argument and having no Endl flag, which has been removed.
|
||||
Old three Message_Printer::Send() methods remain defined virtual with unused last argument and redirecting to new send() method by default.
|
||||
|
||||
@subsection upgrade_750_prd3d_root Prs3d_Root deprecation
|
||||
|
||||
Redundant class Prs3d_Root has been marked as deprecated - Prs3d_Presentation::NewGroup() should be called directly.
|
||||
|
||||
@subsection upgrade_750_draw_hotkeys Draw Harness hotkeys
|
||||
|
||||
Draw Harness hotkeys **W** (Wireframe) and **S** (Shaded) have been re-mapped to **Ctrl+W** and **Ctrl+S**.
|
||||
|
@@ -1542,38 +1542,40 @@ Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDispCon
|
||||
// create a Viewer to this Driver
|
||||
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aGraphicDriver);
|
||||
aViewer->SetDefaultBackgroundColor (Quantity_NOC_DARKVIOLET);
|
||||
aViewer->SetDefaultViewProj (V3d_Xpos);
|
||||
// Create a structure in this Viewer
|
||||
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (aViewer->StructureManager());
|
||||
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (aViewer->Viewer());
|
||||
aStruct->SetVisual (Graphic3d_TOS_SHADING); // Type of structure
|
||||
|
||||
// Create a group of primitives in this structure
|
||||
Handle(Graphic3d_Group) aPrsGroup = aStruct->NewGroup();
|
||||
Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
|
||||
|
||||
// Fill this group with one quad of size 100
|
||||
Handle(Graphic3d_ArrayOfTriangleStrips) aTriangles = new Graphic3d_ArrayOfTriangleStrips (4);
|
||||
aTriangles->AddVertex (-100./2., -100./2., 0.0);
|
||||
aTriangles->AddVertex (-100./2., 100./2., 0.0);
|
||||
aTriangles->AddVertex ( 100./2., -100./2., 0.0);
|
||||
aTriangles->AddVertex ( 100./2., 100./2., 0.0);
|
||||
Handle(Graphic3d_AspectFillArea3d) anAspects = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_RED,
|
||||
Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0f,
|
||||
Graphic3d_NOM_GOLD, Graphic3d_NOM_GOLD);
|
||||
aPrsGroup->SetGroupPrimitivesAspect (anAspects);
|
||||
aPrsGroup->AddPrimitiveArray (aTriangles);
|
||||
aPrsGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectFillArea3d());
|
||||
|
||||
// Create Ambient and Infinite Lights in this Viewer
|
||||
Handle(V3d_AmbientLight) aLight1 = new V3d_AmbientLight (Quantity_NOC_GRAY50);
|
||||
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (V3d_Zneg, Quantity_NOC_WHITE, true);
|
||||
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (V3d_XnegYnegZneg, Quantity_NOC_WHITE);
|
||||
aViewer->AddLight (aLight1);
|
||||
aViewer->AddLight (aLight2);
|
||||
aViewer->SetLightOn();
|
||||
|
||||
// Create a 3D quality Window with the same DisplayConnection
|
||||
Handle(Xw_Window) aWindow = new Xw_Window (aDispConnection, "Test V3d", 100, 100, 500, 500);
|
||||
aWindow->Map(); // Map this Window to this screen
|
||||
|
||||
// Create a Perspective View in this Viewer
|
||||
Handle(V3d_View) aView = new V3d_View (aViewer);
|
||||
aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
|
||||
// Associate this View with the Window
|
||||
aView->SetWindow (aWindow);
|
||||
// Display presentation in this View
|
||||
aStruct->Display();
|
||||
// Display ALL structures in this View
|
||||
aViewer->Viewer()->Display();
|
||||
// Finally update the Visualization in this View
|
||||
aView->Update();
|
||||
// Fit view to object size
|
||||
|
@@ -1,7 +1,6 @@
|
||||
// include required OCCT headers
|
||||
#include <Standard_Version.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <Message_ProgressScope.hxx>
|
||||
//for OCC graphic
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
@@ -4,7 +4,6 @@
|
||||
// include required OCCT headers
|
||||
#include <Standard_Version.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <Message_ProgressScope.hxx>
|
||||
//for OCC graphic
|
||||
#include <WNT_Window.hxx>
|
||||
#include <WNT_WClass.hxx>
|
||||
|
@@ -66,6 +66,6 @@ void OcctJni_MsgPrinter::send (const TCollection_AsciiString& theString,
|
||||
}
|
||||
|
||||
jstring aJStr = myJEnv->NewStringUTF ((theString + "\n").ToCString());
|
||||
myJEnv->CallVoidMethod (myJObj, myJMet, aJStr);
|
||||
myJEnv->CallObjectMethod (myJObj, myJMet, aJStr);
|
||||
myJEnv->DeleteLocalRef (aJStr);
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer )
|
||||
{
|
||||
Handle(Graphic3d_Group) aPrsGroup = thePrs->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aPrsGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
|
||||
|
||||
|
@@ -84,10 +84,10 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrims->AddVertex (myPnt);
|
||||
aPrims->AddVertex (aLastPoint);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
aLastPoint,
|
||||
myDir,
|
||||
anArrowAspect->Angle(),
|
||||
@@ -97,7 +97,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
if (myText.Length() != 0)
|
||||
{
|
||||
gp_Pnt aTextPosition = aLastPoint;
|
||||
Prs3d_Text::Draw (aPresentation->CurrentGroup(),
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
myDrawer->TextAspect(),
|
||||
myText,
|
||||
aTextPosition);
|
||||
|
@@ -214,6 +214,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
|
@@ -42,10 +42,10 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*a
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrims->AddVertex (myStartPnt);
|
||||
aPrims->AddVertex (myEndPnt);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
myEndPnt,
|
||||
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
||||
anArrowAspect->Angle(),
|
||||
|
@@ -126,6 +126,7 @@
|
||||
#include <Plate_GtoCConstraint.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <GeomPlate_Surface.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
|
@@ -46,7 +46,7 @@ void Sample2D_Face::DrawMarker(const Handle(Geom2d_TrimmedCurve)& theCurve, cons
|
||||
anArrow->AddVertex(aPoint);
|
||||
anArrow->AddVertex(aRight);
|
||||
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(anArrow);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(anArrow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,19 +212,19 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
{
|
||||
case TopAbs_FORWARD: {
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_REVERSED: {
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_INTERNAL: {
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
|
||||
mySeq_INTERNAL.Append(aCurve3d);
|
||||
@@ -232,7 +232,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
}
|
||||
case TopAbs_EXTERNAL: {
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
@@ -242,17 +242,17 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
ex.Next();
|
||||
}
|
||||
//add all primitives to the presentation
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myForwardArray);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myForwardArray);
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myReversedArray);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myReversedArray);
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myInternalArray);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myInternalArray);
|
||||
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myExternalArray);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myExternalArray);
|
||||
}
|
||||
|
||||
//Method for advanced customizable selection of picked object
|
||||
@@ -275,7 +275,8 @@ void Sample2D_Face::HilightSelected
|
||||
aSelectionPrs->Clear();
|
||||
FillData();
|
||||
|
||||
Handle (Graphic3d_Group) aSelectGroup = aSelectionPrs->NewGroup();
|
||||
Prs3d_Root::NewGroup ( aSelectionPrs );
|
||||
Handle (Graphic3d_Group) aSelectGroup = Prs3d_Root::CurrentGroup ( aSelectionPrs);
|
||||
|
||||
for(Standard_Integer i=1; i<=aLength; ++i)
|
||||
{
|
||||
@@ -343,7 +344,8 @@ void Sample2D_Face::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationMana
|
||||
FillData();
|
||||
|
||||
//Direct highlighting
|
||||
Handle (Graphic3d_Group) aHilightGroup = aHighlightPrs->NewGroup();
|
||||
Prs3d_Root::NewGroup ( aHighlightPrs );
|
||||
Handle (Graphic3d_Group) aHilightGroup = Prs3d_Root::CurrentGroup(aHighlightPrs);
|
||||
Handle(Graphic3d_AspectLine3d) aLineAspect =
|
||||
new Graphic3d_AspectLine3d(theStyle->Color(), Aspect_TOL_SOLID,2);
|
||||
switch(theOwner->Priority())
|
||||
|
@@ -43,15 +43,15 @@ void Sample2D_Markers::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
if(myMarkerType == Aspect_TOM_USERDEFINED)
|
||||
{
|
||||
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
|
||||
aPresentation->CurrentGroup()->SetGroupPrimitivesAspect(aMarker);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (myArrayOfPoints);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect(aMarker);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
|
||||
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
|
||||
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
||||
}
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
|
@@ -76,7 +76,7 @@ case 6: //color
|
||||
|
||||
Handle(Graphic3d_StructureManager) aStrucMana = GetContext()->MainPrsMgr()->StructureManager();
|
||||
|
||||
Handle(Graphic3d_Group) mygroup = aPresentation->CurrentGroup();
|
||||
Handle(Graphic3d_Group) mygroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
myAspect = (new Prs3d_ShadingAspect())->Aspect();
|
||||
Graphic3d_MaterialAspect material = myAspect->FrontMaterial();
|
||||
material.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
@@ -281,7 +281,7 @@ case 6: //color
|
||||
} // end of "if the triangle is valid
|
||||
} // end of the "parcours" of the triangles
|
||||
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aOP);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aOP);
|
||||
|
||||
mygroup->SetGroupPrimitivesAspect(myAspect);
|
||||
}// end of the exploration of the shape in faces
|
||||
|
@@ -54,14 +54,16 @@ vbsdf s -absorpCoeff 6
|
||||
# setup first inner box
|
||||
box c 0.3 0.3 0.2
|
||||
vdisplay -noupdate c
|
||||
vlocation -noupdate c -reset -rotate 0 0 0 0 0 1 -30 -translate 0.55 0.3 0.0
|
||||
vlocation -noupdate c -setLocation 0.55 0.3 0.0
|
||||
vlocation -noupdate c -rotate 0 0 0 0 0 1 -30
|
||||
vsetmaterial -noupdate c plastic
|
||||
vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
|
||||
|
||||
# setup second inner box
|
||||
box g 0.15 0.15 0.3
|
||||
vdisplay -noupdate g
|
||||
vlocation -noupdate g -reset -rotate 0 0 0 0 0 1 10 -translate 0.7 0.25 0.2
|
||||
vlocation -noupdate g -setLocation 0.7 0.25 0.2
|
||||
vlocation -noupdate g -rotate 0 0 0 0 0 1 10
|
||||
vsetmaterial -noupdate g glass
|
||||
vbsdf g -absorpColor 0.8 1.0 0.8
|
||||
vbsdf g -absorpCoeff 6
|
||||
|
@@ -109,13 +109,13 @@ void WasmOcctView::initWindow()
|
||||
{
|
||||
myDevicePixelRatio = jsDevicePixelRatio();
|
||||
myCanvasId = THE_CANVAS_ID;
|
||||
const char* aTargetId = !myCanvasId.IsEmpty() ? myCanvasId.ToCString() : EMSCRIPTEN_EVENT_TARGET_WINDOW;
|
||||
const char* aTargetId = !myCanvasId.IsEmpty() ? myCanvasId.ToCString() : NULL;
|
||||
const EM_BOOL toUseCapture = EM_TRUE;
|
||||
emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onResizeCallback);
|
||||
emscripten_set_resize_callback (NULL, this, toUseCapture, onResizeCallback);
|
||||
|
||||
emscripten_set_mousedown_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mousedown_callback (NULL, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mouseup_callback (NULL, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mousemove_callback (NULL, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_dblclick_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_click_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
emscripten_set_mouseenter_callback (aTargetId, this, toUseCapture, onMouseCallback);
|
||||
@@ -127,9 +127,9 @@ void WasmOcctView::initWindow()
|
||||
emscripten_set_touchmove_callback (aTargetId, this, toUseCapture, onTouchCallback);
|
||||
emscripten_set_touchcancel_callback(aTargetId, this, toUseCapture, onTouchCallback);
|
||||
|
||||
//emscripten_set_keypress_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyCallback);
|
||||
emscripten_set_keydown_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyDownCallback);
|
||||
emscripten_set_keyup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyUpCallback);
|
||||
//emscripten_set_keypress_callback (NULL, this, toUseCapture, onKeyCallback);
|
||||
emscripten_set_keydown_callback (NULL, this, toUseCapture, onKeyDownCallback);
|
||||
emscripten_set_keyup_callback (NULL, this, toUseCapture, onKeyUpCallback);
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
@@ -396,7 +396,7 @@ EM_BOOL WasmOcctView::onMouseEvent (int theEventType, const EmscriptenMouseEvent
|
||||
|
||||
Graphic3d_Vec2i aWinSize;
|
||||
myView->Window()->Size (aWinSize.x(), aWinSize.y());
|
||||
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->targetX, theEvent->targetY));
|
||||
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->canvasX, theEvent->canvasY));
|
||||
Aspect_VKeyFlags aFlags = 0;
|
||||
if (theEvent->ctrlKey == EM_TRUE) { aFlags |= Aspect_VKeyFlags_CTRL; }
|
||||
if (theEvent->shiftKey == EM_TRUE) { aFlags |= Aspect_VKeyFlags_SHIFT; }
|
||||
@@ -477,7 +477,7 @@ EM_BOOL WasmOcctView::onWheelEvent (int theEventType, const EmscriptenWheelEvent
|
||||
|
||||
Graphic3d_Vec2i aWinSize;
|
||||
myView->Window()->Size (aWinSize.x(), aWinSize.y());
|
||||
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->mouse.targetX, theEvent->mouse.targetY));
|
||||
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->mouse.canvasX, theEvent->mouse.canvasY));
|
||||
if (aNewPos.x() < 0 || aNewPos.x() > aWinSize.x()
|
||||
|| aNewPos.y() < 0 || aNewPos.y() > aWinSize.y())
|
||||
{
|
||||
|
@@ -19,13 +19,6 @@
|
||||
//! Global viewer instance.
|
||||
static WasmOcctView aViewer;
|
||||
|
||||
//! Dummy main loop callback for a single shot.
|
||||
extern "C" void onMainLoop()
|
||||
{
|
||||
// do nothing here - viewer updates are handled on demand
|
||||
emscripten_cancel_main_loop();
|
||||
}
|
||||
|
||||
//! File data read event.
|
||||
extern "C" void onFileDataRead (void* theOpaque, void* theBuffer, int theDataLen)
|
||||
{
|
||||
@@ -67,10 +60,6 @@ int main()
|
||||
Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("webgl-sample", Message_Trace);
|
||||
Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter); // open JavaScript console within the Browser to see this output
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString("NbLogicalProcessors: ") + OSD_Parallel::NbLogicalProcessors(), Message_Trace);
|
||||
|
||||
// setup a dummy single-shot main loop callback just to shut up a useless Emscripten error message on calling eglSwapInterval()
|
||||
emscripten_set_main_loop (onMainLoop, -1, 0);
|
||||
|
||||
aViewer.run();
|
||||
Message::DefaultMessenger()->Send (OSD_MemInfo::PrintInfo(), Message_Trace);
|
||||
|
||||
|
@@ -69,7 +69,6 @@ var Module =
|
||||
printErr: function(theText) {
|
||||
//var anElement = document.getElementById('output');
|
||||
//anElement.innerHTML += theText + "<br>";
|
||||
console.warn(theText);
|
||||
},
|
||||
canvas: (function() {
|
||||
var aCanvas = document.getElementById('canvas');
|
||||
@@ -86,12 +85,11 @@ fileInput.onchange = function()
|
||||
var aReader = new FileReader();
|
||||
aReader.onload = function()
|
||||
{
|
||||
var aNameLenBytes = lengthBytesUTF8(aFile.name) + 1;
|
||||
const aNameBuffer = Module._malloc(aNameLenBytes);
|
||||
stringToUTF8(aFile.name, aNameBuffer, aNameLenBytes);
|
||||
|
||||
var aDataArray = new Uint8Array (aReader.result);
|
||||
var aNameArray = new Uint8Array (toUtf8Array (aFile.name));
|
||||
const aDataBuffer = Module._malloc(aDataArray.length);
|
||||
const aNameBuffer = Module._malloc(aNameArray.length);
|
||||
Module.HEAPU8.set(aNameArray, aNameBuffer);
|
||||
Module.HEAPU8.set(aDataArray, aDataBuffer);
|
||||
Module.ccall('onFileDataRead', null, ['number', 'number', 'number'], [aNameBuffer, aDataBuffer, aDataArray.length]);
|
||||
Module._free(aDataBuffer);
|
||||
@@ -100,6 +98,35 @@ fileInput.onchange = function()
|
||||
};
|
||||
aReader.readAsArrayBuffer(aFile);
|
||||
};
|
||||
|
||||
//! Convert string into UTF-8 array.
|
||||
function toUtf8Array (theText)
|
||||
{
|
||||
var aRes = [];
|
||||
for (var aCharIter = 0; aCharIter < theText.length; ++aCharIter)
|
||||
{
|
||||
var aCharCode = theText.charCodeAt (aCharIter);
|
||||
if (aCharCode < 0x80)
|
||||
{
|
||||
aRes.push (aCharCode);
|
||||
}
|
||||
else if (aCharCode < 0x800)
|
||||
{
|
||||
aRes.push (0xc0 | (aCharCode >> 6), 0x80 | (aCharCode & 0x3f));
|
||||
}
|
||||
else if (aCharCode < 0xd800 || aCharCode >= 0xe000)
|
||||
{
|
||||
aRes.push (0xe0 | (aCharCode >> 12), 0x80 | ((aCharCode>>6) & 0x3f), 0x80 | (aCharCode & 0x3f));
|
||||
}
|
||||
else
|
||||
{
|
||||
++aCharIter;
|
||||
aCharCode = 0x10000 + (((aCharCode & 0x3ff)<<10) | (theText.charCodeAt (aCharIter) & 0x3ff));
|
||||
aRes.push(0xf0 | (aCharCode >>18), 0x80 | ((aCharCode>>12) & 0x3f), 0x80 | ((aCharCode>>6) & 0x3f), 0x80 | (aCharCode & 0x3f));
|
||||
}
|
||||
}
|
||||
return aRes;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="occt-webgl-sample.js" charset="utf-8"></script>
|
||||
</body>
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <Graphic3d_Text.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <StdSelect_BRepSelectionTool.hxx>
|
||||
|
@@ -128,7 +128,7 @@ myMainVwr(MainViewer),
|
||||
myMainSel(new StdSelect_ViewerSelector3d()),
|
||||
myToHilightSelected(Standard_True),
|
||||
mySelection(new AIS_Selection()),
|
||||
myFilters (new SelectMgr_AndOrFilter(SelectMgr_FilterType_OR)),
|
||||
myFilters(new SelectMgr_OrFilter()),
|
||||
myDefaultDrawer(new Prs3d_Drawer()),
|
||||
myCurDetected(0),
|
||||
myCurHighlighted(0),
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_TypeOfHighlight.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_AndOrFilter.hxx>
|
||||
#include <SelectMgr_IndexedMapOfOwner.hxx>
|
||||
#include <SelectMgr_ListOfFilter.hxx>
|
||||
#include <SelectMgr_PickingStrategy.hxx>
|
||||
@@ -47,6 +46,7 @@
|
||||
|
||||
class SelectMgr_SelectionManager;
|
||||
class V3d_Viewer;
|
||||
class SelectMgr_OrFilter;
|
||||
class V3d_View;
|
||||
class TopLoc_Location;
|
||||
class TCollection_ExtendedString;
|
||||
@@ -736,15 +736,6 @@ public: //! @name management of active Selection Modes
|
||||
|
||||
public: //! @name Selection Filters management
|
||||
|
||||
//! @return the context selection filter type.
|
||||
SelectMgr_FilterType FilterType() const { return myFilters->FilterType(); }
|
||||
|
||||
//! Sets the context selection filter type.
|
||||
//! SelectMgr_TypeFilter_OR selection filter is used by default.
|
||||
//! @param theFilterType the filter type.
|
||||
void SetFilterType (const SelectMgr_FilterType theFilterType)
|
||||
{ myFilters->SetFilterType (theFilterType); }
|
||||
|
||||
//! Returns the list of filters active in a local context.
|
||||
Standard_EXPORT const SelectMgr_ListOfFilter& Filters() const;
|
||||
|
||||
@@ -1341,7 +1332,14 @@ protected: //! @name internal methods
|
||||
if (myLastPicked.IsNull())
|
||||
return;
|
||||
|
||||
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
|
||||
if (myLastPicked->IsAutoHilight())
|
||||
{
|
||||
myMainPM->ClearImmediateDraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
|
||||
}
|
||||
}
|
||||
|
||||
//! Bind/Unbind status to object and its children
|
||||
@@ -1363,8 +1361,7 @@ protected: //! @name internal fields
|
||||
Handle(SelectMgr_EntityOwner) myLastPicked;
|
||||
Standard_Boolean myToHilightSelected;
|
||||
Handle(AIS_Selection) mySelection;
|
||||
Handle(SelectMgr_AndOrFilter) myFilters; //!< context filter (the content active filters
|
||||
//! can be applied with AND or OR operation)
|
||||
Handle(SelectMgr_OrFilter) myFilters;
|
||||
Handle(Prs3d_Drawer) myDefaultDrawer;
|
||||
Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
|
||||
TColStd_SequenceOfInteger myDetectedSeq;
|
||||
|
@@ -172,8 +172,8 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
|
||||
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);
|
||||
if (!aStatusPtr)
|
||||
Handle(AIS_GlobalStatus) aStatus;
|
||||
if (!myObjects.Find (anInteractive, aStatus))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -183,9 +183,9 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
anOwner->Unhilight (myMainPM);
|
||||
if (theIsToHilightSubIntensity)
|
||||
{
|
||||
if ((*aStatusPtr)->IsSubIntensityOn())
|
||||
if (aStatus->IsSubIntensityOn())
|
||||
{
|
||||
const Standard_Integer aHiMode = getHilightMode (anInteractive, (*aStatusPtr)->HilightStyle(), (*aStatusPtr)->DisplayMode());
|
||||
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
|
||||
highlightWithSubintensity (anOwner, aHiMode);
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
}
|
||||
if (anOwner == anInteractive->GlobalSelOwner())
|
||||
{
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_False);
|
||||
aStatus->SetHilightStatus (Standard_False);
|
||||
}
|
||||
}
|
||||
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
|
||||
@@ -746,15 +746,11 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
continue;
|
||||
|
||||
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
|
||||
if (anOwner == anObj->GlobalSelOwner())
|
||||
{
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_True);
|
||||
(*aStatusPtr)->SetHilightStyle (anObjSelStyle);
|
||||
aState->SetHilightStatus (Standard_True);
|
||||
aState->SetHilightStyle (anObjSelStyle);
|
||||
}
|
||||
if (!anOwner->IsAutoHilight())
|
||||
{
|
||||
@@ -772,7 +768,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
}
|
||||
else
|
||||
{
|
||||
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, (*aStatusPtr)->DisplayMode());
|
||||
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
|
||||
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
|
||||
}
|
||||
}
|
||||
@@ -876,10 +872,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
if (aSelOwner == aSelectable->GlobalSelOwner())
|
||||
{
|
||||
if (Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable))
|
||||
{
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,12 +990,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
if (myAutoHilight)
|
||||
{
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
|
||||
if (theOwner->IsSelected())
|
||||
{
|
||||
highlightSelected (theOwner);
|
||||
@@ -1013,7 +1001,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
anOwners.Append (theOwner);
|
||||
unhighlightOwners (anOwners);
|
||||
|
||||
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <SelectMgr_Filter.hxx>
|
||||
#include <SelectMgr_OrFilter.hxx>
|
||||
#include <SelectMgr_SelectionManager.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
@@ -56,20 +56,6 @@ void AIS_InteractiveObject::Redisplay (const Standard_Boolean AllModes)
|
||||
myCTXPtr->Redisplay (this, Standard_False, AllModes);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ProcessDragging
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveObject::ProcessDragging (const Handle(AIS_InteractiveContext)&,
|
||||
const Handle(V3d_View)&,
|
||||
const Handle(SelectMgr_EntityOwner)&,
|
||||
const Graphic3d_Vec2i&,
|
||||
const Graphic3d_Vec2i&,
|
||||
const AIS_DragAction)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
|
@@ -18,14 +18,12 @@
|
||||
#define _AIS_InteractiveObject_HeaderFile
|
||||
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_DragAction.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
|
||||
class AIS_InteractiveContext;
|
||||
class Graphic3d_MaterialAspect;
|
||||
class Prs3d_BasicAspect;
|
||||
class Bnd_Box;
|
||||
class V3d_View;
|
||||
|
||||
//! Defines a class of objects with display and selection services.
|
||||
//! Entities which are visualized and selected are Interactive Objects.
|
||||
@@ -105,21 +103,6 @@ public:
|
||||
//! This method removes the owner from the graphic entity.
|
||||
void ClearOwner() { myOwner.Nullify(); }
|
||||
|
||||
//! Drag object in the viewer.
|
||||
//! @param theCtx [in] interactive context
|
||||
//! @param theView [in] active View
|
||||
//! @param theOwner [in] the owner of detected entity
|
||||
//! @param theDragFrom [in] drag start point
|
||||
//! @param theDragTo [in] drag end point
|
||||
//! @param theAction [in] drag action
|
||||
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
|
||||
Standard_EXPORT virtual Standard_Boolean ProcessDragging (const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction);
|
||||
|
||||
public:
|
||||
|
||||
//! Returns the context pointer to the interactive context.
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <gce_MakeDir.hxx>
|
||||
#include <IntAna_IntConicQuad.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_ToolDisk.hxx>
|
||||
#include <Prs3d_ToolSector.hxx>
|
||||
@@ -639,44 +640,6 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ProcessDragging
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveContext)&,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)&,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction)
|
||||
{
|
||||
switch (theAction)
|
||||
{
|
||||
case AIS_DragAction_Start:
|
||||
{
|
||||
if (HasActiveMode())
|
||||
{
|
||||
StartTransform (theDragFrom.x(), theDragFrom.y(), theView);
|
||||
return Standard_True;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AIS_DragAction_Update:
|
||||
{
|
||||
Transform (theDragTo.x(), theDragTo.y(), theView);
|
||||
return Standard_True;
|
||||
}
|
||||
case AIS_DragAction_Abort:
|
||||
{
|
||||
StopTransform (false);
|
||||
return Standard_True;
|
||||
}
|
||||
case AIS_DragAction_Stop:
|
||||
break;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : StartTransform
|
||||
//purpose :
|
||||
@@ -1250,8 +1213,7 @@ void AIS_Manipulator::Disk::Init (const Standard_ShortReal theInnerRadius,
|
||||
gp_Ax3 aSystem (myPosition.Location(), myPosition.Direction());
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation (aSystem, gp_Ax3());
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
aTool.FillArray (myArray, myTriangulation, aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1270,8 +1232,7 @@ void AIS_Manipulator::Sphere::Init (const Standard_ShortReal theRadius,
|
||||
Prs3d_ToolSphere aTool (theRadius, theSlicesNb, theStacksNb);
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTranslation (gp_Vec(gp::Origin(), thePosition));
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
aTool.FillArray (myArray, myTriangulation, aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1307,24 +1268,24 @@ void AIS_Manipulator::Cube::Init (const gp_Ax1& thePosition, const Standard_Shor
|
||||
addTriangle (1, aBottomLeft, aV3, aV4, -thePosition.Direction());
|
||||
|
||||
// Front
|
||||
addTriangle (2, aV3, aV5, aV4, -aFront);
|
||||
addTriangle (3, aV3, aTopRight, aV5, -aFront);
|
||||
addTriangle (2, aV3, aV4, aV5, aFront);
|
||||
addTriangle (3, aV3, aV5, aTopRight, aFront);
|
||||
|
||||
// Back
|
||||
addTriangle (4, aBottomLeft, aV7, aV2, aFront);
|
||||
addTriangle (5, aBottomLeft, aV6, aV7, aFront);
|
||||
addTriangle (4, aBottomLeft, aV2, aV7, -aFront);
|
||||
addTriangle (5, aBottomLeft, aV7, aV6, -aFront);
|
||||
|
||||
// aTop
|
||||
addTriangle (6, aV7, aV6, aV5, thePosition.Direction());
|
||||
addTriangle (7, aTopRight, aV7, aV5, thePosition.Direction());
|
||||
|
||||
// Left
|
||||
addTriangle (8, aV6, aV4, aV5, aRight);
|
||||
addTriangle (9, aBottomLeft, aV4, aV6, aRight);
|
||||
//Left
|
||||
addTriangle (8, aV6, aV5, aV4, -aRight);
|
||||
addTriangle (9, aBottomLeft, aV6, aV4, -aRight);
|
||||
|
||||
// Right
|
||||
addTriangle (10, aV3, aV7, aTopRight, -aRight);
|
||||
addTriangle (11, aV3, aV2, aV7, -aRight);
|
||||
addTriangle (10, aV3, aTopRight, aV7, aRight);
|
||||
addTriangle (11, aV3, aV7, aV2, aRight);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1361,8 +1322,7 @@ void AIS_Manipulator::Sector::Init (const Standard_ShortReal theRadius,
|
||||
gp_Ax3 aSystem(thePosition.Location(), thePosition.Direction(), theXDirection);
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation(aSystem, gp_Ax3());
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
aTool.FillArray(myArray, myTriangulation, aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1414,8 +1374,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myAxisRadius * 1.5,
|
||||
anArrowLength,
|
||||
myFacettesNumber);
|
||||
myTranslatorGroup = thePrs->NewGroup();
|
||||
myTranslatorGroup->SetClosed (true);
|
||||
myTranslatorGroup = thePrs->NewGroup ();
|
||||
myTranslatorGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myTranslatorGroup->AddPrimitiveArray (myTriangleArray);
|
||||
|
||||
@@ -1428,7 +1387,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightTranslator->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightTranslator->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightTranslator);
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myTriangleArray);
|
||||
}
|
||||
@@ -1439,8 +1398,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myCubePos = myReferenceAxis.Direction().XYZ() * (myLength + myIndent);
|
||||
myCube.Init (gp_Ax1 (myCubePos, myReferenceAxis.Direction()), myBoxSize);
|
||||
|
||||
myScalerGroup = thePrs->NewGroup();
|
||||
myScalerGroup->SetClosed (true);
|
||||
myScalerGroup = thePrs->NewGroup ();
|
||||
myScalerGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myScalerGroup->AddPrimitiveArray (myCube.Array());
|
||||
|
||||
@@ -1453,7 +1411,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightScaler->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightScaler->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightScaler);
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myCube.Array());
|
||||
}
|
||||
@@ -1476,7 +1434,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightRotator->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightRotator->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightRotator);
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myCircle.Array());
|
||||
}
|
||||
@@ -1508,7 +1466,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightDragger->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightDragger->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(myHighlightDragger);
|
||||
aGroup->SetGroupPrimitivesAspect(aFillArea);
|
||||
aGroup->AddPrimitiveArray(mySector.Array());
|
||||
}
|
||||
|
@@ -163,20 +163,6 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
//! Drag object in the viewer.
|
||||
//! @param theCtx [in] interactive context
|
||||
//! @param theView [in] active View
|
||||
//! @param theOwner [in] the owner of detected entity
|
||||
//! @param theDragFrom [in] drag start point
|
||||
//! @param theDragTo [in] drag end point
|
||||
//! @param theAction [in] drag action
|
||||
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
|
||||
Standard_EXPORT virtual Standard_Boolean ProcessDragging (const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction) Standard_OVERRIDE;
|
||||
|
||||
//! Init start (reference) transformation.
|
||||
//! @warning It is used in chain with StartTransform-Transform(gp_Trsf)-StopTransform
|
||||
|
@@ -258,7 +258,7 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
{
|
||||
ComputeFrame();
|
||||
Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
|
||||
gp_Pnt p1;
|
||||
const Standard_Real Xmax = 0.5*Standard_Real(theaspect->PlaneXLength());
|
||||
|
@@ -91,7 +91,7 @@ void AIS_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
StdPrs_Point::Add(aPresentation,myComponent,myDrawer);
|
||||
else if (aMode== -99)
|
||||
{
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
TheGroup->SetPrimitivesAspect (myHilightDrawer->PointAspect()->Aspect());
|
||||
Handle(Graphic3d_ArrayOfPoints) aPoint = new Graphic3d_ArrayOfPoints (1);
|
||||
aPoint->AddVertex (myComponent->X(),myComponent->Y(),myComponent->Z());
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <PrsMgr_Presentations.hxx>
|
||||
#include <Select3D_SensitiveBox.hxx>
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include <Graphic3d_TransModeFlags.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
@@ -43,7 +44,6 @@ AIS_RubberBand::AIS_RubberBand()
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
||||
@@ -66,7 +66,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
myDrawer->ShadingAspect()->SetTransparency (1.0);
|
||||
@@ -92,7 +91,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
|
||||
myDrawer->ShadingAspect()->SetColor (theFillColor);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
|
||||
myDrawer->ShadingAspect()->SetTransparency (theTransparency);
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_BndBox.hxx>
|
||||
#include <StdPrs_ToolTriangulatedShape.hxx>
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <Font_Rect.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_RenderingParams.hxx>
|
||||
#include <Graphic3d_Text.hxx>
|
||||
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
@@ -300,7 +299,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
if (myHasFlipping)
|
||||
{
|
||||
gp_Ax2 aFlippingAxes (aCenterOfLabel, myOrientation3D.Direction(), myOrientation3D.XDirection());
|
||||
thePrs->CurrentGroup()->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
}
|
||||
gp_Ax2 anOrientation = myOrientation3D;
|
||||
anOrientation.SetLocation (aPosition);
|
||||
@@ -309,19 +308,15 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
{
|
||||
aHasOwnAnchor = Standard_False; // always not using own anchor if flipping
|
||||
}
|
||||
Handle(Graphic3d_Text) aText =
|
||||
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, anOrientation, aHasOwnAnchor);
|
||||
aText->SetTextFormatter (myFormatter);
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, anOrientation, aHasOwnAnchor);
|
||||
if (myHasFlipping && isInit)
|
||||
{
|
||||
thePrs->CurrentGroup()->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Graphic3d_Text) aText =
|
||||
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, aPosition);
|
||||
aText->SetTextFormatter (myFormatter);
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, aPosition);
|
||||
}
|
||||
|
||||
if (isInit)
|
||||
@@ -333,7 +328,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
gp_Pnt aMinPnt = gp_Pnt (-aDx, -aDy, 0.0).Transformed (aLabelPlane);
|
||||
gp_Pnt aMaxPnt = gp_Pnt ( aDx, aDy, 0.0).Transformed (aLabelPlane);
|
||||
|
||||
Graphic3d_BndBox4f& aBox = thePrs->CurrentGroup()->ChangeBoundingBox();
|
||||
Graphic3d_BndBox4f& aBox = Prs3d_Root::CurrentGroup (thePrs)->ChangeBoundingBox();
|
||||
aBox.Add (Graphic3d_Vec4 ((float) aMinPnt.X(), (float) aMinPnt.Y(), (float) aMinPnt.Z(), 1.0));
|
||||
aBox.Add (Graphic3d_Vec4 ((float) aMaxPnt.X(), (float) aMaxPnt.Y(), (float) aMaxPnt.Z(), 1.0));
|
||||
}
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include <Font_FontAspect.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
class Font_TextFormatter;
|
||||
|
||||
//! Presentation of the text.
|
||||
class AIS_TextLabel : public AIS_InteractiveObject
|
||||
{
|
||||
@@ -123,12 +121,6 @@ public:
|
||||
//! and the colour of backgroubd for the TODT_DEKALE TextDisplayType.
|
||||
Standard_EXPORT void SetColorSubTitle (const Quantity_Color& theColor);
|
||||
|
||||
//! Returns text presentation formatter; NULL by default, which means standard text formatter will be used.
|
||||
const Handle(Font_TextFormatter)& TextFormatter() const { return myFormatter; }
|
||||
|
||||
//! Setup text formatter for presentation. It's empty by default.
|
||||
void SetTextFormatter (const Handle(Font_TextFormatter)& theFormatter) { myFormatter = theFormatter; }
|
||||
|
||||
protected:
|
||||
|
||||
//! Compute
|
||||
@@ -152,8 +144,6 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Font_TextFormatter) myFormatter;
|
||||
|
||||
TCollection_ExtendedString myText;
|
||||
gp_Ax2 myOrientation3D;
|
||||
Standard_Boolean myHasOrientation3D;
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
|
@@ -11,14 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Triangulation.hxx>
|
||||
|
||||
#include <AIS_DisplayMode.hxx>
|
||||
#include <AIS_Triangulation.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Poly_Array1OfTriangle.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <TShort_Array1OfShortReal.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
@@ -131,7 +131,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) anArray = new Graphic3d_ArrayOfTriangles (myNbNodes, myNbTriangles * 3,
|
||||
hasVNormals, hasVColors, Standard_False);
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_AspectFillArea3d) aspect = myDrawer->ShadingAspect()->Aspect();
|
||||
|
||||
Standard_Integer i;
|
||||
|
@@ -298,7 +298,7 @@ void AIS_Trihedron::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManag
|
||||
|
||||
aPresentation->Clear();
|
||||
const Prs3d_DatumParts aPart = anOwner->DatumPart();
|
||||
Handle(Graphic3d_Group) aGroup = aPresentation->CurrentGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
|
||||
if (aPart >= Prs3d_DP_XOYAxis && aPart <= Prs3d_DP_XOZAxis)
|
||||
{
|
||||
// planes selection is equal in both shading and wireframe mode
|
||||
@@ -443,7 +443,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
// display origin
|
||||
{
|
||||
// Origin is visualized only in shading mode
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
const Prs3d_DatumParts aPart = Prs3d_DP_Origin;
|
||||
if (anAspect->DrawDatumPart(aPart))
|
||||
{
|
||||
@@ -470,7 +470,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) anAxisGroup = thePrs->NewGroup();
|
||||
Handle(Graphic3d_Group) anAxisGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
myPartToGroup.Bind (aPart, anAxisGroup);
|
||||
if (isShadingMode)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) anArrowGroup = thePrs->NewGroup();
|
||||
Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
anArrowGroup->SetGroupPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
|
||||
anArrowGroup->AddPrimitiveArray (arrayOfPrimitives (anArrowPart));
|
||||
}
|
||||
@@ -518,7 +518,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
case Prs3d_DP_ZAxis: aDir = aComponent->Direction(); break;
|
||||
default: break;
|
||||
}
|
||||
Handle(Graphic3d_Group) aLabelGroup = thePrs->NewGroup();
|
||||
Handle(Graphic3d_Group) aLabelGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
const gp_Pnt aPoint = anOrigin.XYZ() + aDir.XYZ() * anAxisLength;
|
||||
Prs3d_Text::Draw (aLabelGroup, anAspect->TextAspect(), aLabel, aPoint);
|
||||
}
|
||||
@@ -533,7 +533,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
myPartToGroup.Bind (aPart, aGroup);
|
||||
|
||||
aGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <AIS_AnimationCamera.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Manipulator.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_RubberBand.hxx>
|
||||
#include <AIS_XRTrackedDevice.hxx>
|
||||
@@ -118,7 +119,7 @@ AIS_ViewController::AIS_ViewController()
|
||||
myAnchorPointPrs2->SetZLayer (Graphic3d_ZLayerId_Topmost);
|
||||
myAnchorPointPrs2->SetMutable (true);
|
||||
|
||||
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE4, 0.5, 1.0);
|
||||
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE, 0.4, 1.0);
|
||||
myRubberBand->SetZLayer (Graphic3d_ZLayerId_TopOSD);
|
||||
myRubberBand->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_UPPER));
|
||||
myRubberBand->SetDisplayMode (0);
|
||||
@@ -2610,20 +2611,19 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
case AIS_DragAction_Start:
|
||||
{
|
||||
myDragObject.Nullify();
|
||||
myDragOwner.Nullify();
|
||||
if (!theCtx->HasDetected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Handle(SelectMgr_EntityOwner)& aDetectedOwner = theCtx->DetectedOwner();
|
||||
Handle(AIS_InteractiveObject) aDetectedPrs = Handle(AIS_InteractiveObject)::DownCast (aDetectedOwner->Selectable());
|
||||
|
||||
if (aDetectedPrs->ProcessDragging (theCtx, theView, aDetectedOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction))
|
||||
Handle(AIS_InteractiveObject) aPrs = theCtx->DetectedInteractive();
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (aPrs))
|
||||
{
|
||||
myDragObject = aDetectedPrs;
|
||||
myDragOwner = aDetectedOwner;
|
||||
if (aManip->HasActiveMode())
|
||||
{
|
||||
myDragObject = aManip;
|
||||
aManip->StartTransform (myGL.Dragging.PointStart.x(), myGL.Dragging.PointStart.y(), theView);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2638,9 +2638,10 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
{
|
||||
theCtx->SetSelectedState (aGlobOwner, true);
|
||||
}
|
||||
|
||||
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction);
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
|
||||
{
|
||||
aManip->Transform (myGL.Dragging.PointTo.x(), myGL.Dragging.PointTo.y(), theView);
|
||||
}
|
||||
theView->Invalidate();
|
||||
return;
|
||||
}
|
||||
@@ -2654,8 +2655,10 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
myGL.Dragging.PointTo = myGL.Dragging.PointStart;
|
||||
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
|
||||
|
||||
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction);
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
|
||||
{
|
||||
aManip->StopTransform (false);
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
}
|
||||
case AIS_DragAction_Stop:
|
||||
@@ -2670,11 +2673,8 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
theCtx->SetSelectedState (aGlobOwner, false);
|
||||
}
|
||||
|
||||
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction);
|
||||
theView->Invalidate();
|
||||
myDragObject.Nullify();
|
||||
myDragOwner.Nullify();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ class AIS_Point;
|
||||
class AIS_RubberBand;
|
||||
class AIS_XRTrackedDevice;
|
||||
class Graphic3d_Camera;
|
||||
class SelectMgr_EntityOwner;
|
||||
class V3d_View;
|
||||
class WNT_HIDSpaceMouse;
|
||||
|
||||
@@ -738,7 +737,6 @@ protected:
|
||||
|
||||
Handle(AIS_AnimationCamera) myViewAnimation; //!< view animation
|
||||
Handle(AIS_RubberBand) myRubberBand; //!< Rubber-band presentation
|
||||
Handle(SelectMgr_EntityOwner) myDragOwner; //!< detected owner of currently dragged object
|
||||
Handle(AIS_InteractiveObject) myDragObject; //!< currently dragged object
|
||||
Graphic3d_Vec2i myPrevMoveTo; //!< previous position of MoveTo event in 3D viewer
|
||||
Standard_Boolean myHasHlrOnBeforeRotation; //!< flag for restoring Computed mode after rotation
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include <Prs3d.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_DatumAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_ToolDisk.hxx>
|
||||
#include <Prs3d_ToolSphere.hxx>
|
||||
@@ -598,7 +599,6 @@ void AIS_ViewCube::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) anAxisGroup = thePrs->NewGroup();
|
||||
anAxisGroup->SetClosed (true);
|
||||
anAxisGroup->SetGroupPrimitivesAspect (aDatumAspect->ShadingAspect (aPart)->Aspect());
|
||||
|
||||
const Standard_Real anArrowLength = 0.2 * anAxisSize;
|
||||
@@ -621,7 +621,6 @@ void AIS_ViewCube::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
// Display center
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetClosed (true);
|
||||
Handle(Prs3d_ShadingAspect) anAspectCen = new Prs3d_ShadingAspect();
|
||||
anAspectCen->SetColor (Quantity_NOC_WHITE);
|
||||
aGroup->SetGroupPrimitivesAspect (anAspectCen->Aspect());
|
||||
|
@@ -22,9 +22,7 @@
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Adaptor3d_HVertex,Standard_Transient)
|
||||
|
||||
Adaptor3d_HVertex::Adaptor3d_HVertex ()
|
||||
: myTol(0.0)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
Adaptor3d_HVertex::Adaptor3d_HVertex (const gp_Pnt2d& P,
|
||||
|
@@ -60,17 +60,8 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real&
|
||||
}
|
||||
|
||||
|
||||
Adaptor3d_TopolTool::Adaptor3d_TopolTool ()
|
||||
: myNbSamplesU(-1),
|
||||
myNbSamplesV(-1),
|
||||
nbRestr(0),
|
||||
idRestr(0),
|
||||
Uinf(0.0),
|
||||
Usup(0.0),
|
||||
Vinf(0.0),
|
||||
Vsup(0.0),
|
||||
nbVtx(0),
|
||||
idVtx(0)
|
||||
Adaptor3d_TopolTool::Adaptor3d_TopolTool () : myNbSamplesU(-1),nbRestr(0),idRestr(0)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -62,18 +62,6 @@ static Standard_Boolean lesparam(const Standard_Integer iordre,
|
||||
|
||||
AdvApp2Var_Context::
|
||||
AdvApp2Var_Context()
|
||||
: myFav(0),
|
||||
myOrdU(0),
|
||||
myOrdV(0),
|
||||
myLimU(0),
|
||||
myLimV(0),
|
||||
myNb1DSS(0),
|
||||
myNb2DSS(0),
|
||||
myNb3DSS(0),
|
||||
myNbURoot(0),
|
||||
myNbVRoot(0),
|
||||
myJDegU(0),
|
||||
myJDegV(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -49,25 +49,7 @@ Standard_EXPORT Standard_Boolean AppBlend_GetContextApproxWithNoTgt();
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
AppBlend_AppSurf::AppBlend_AppSurf ()
|
||||
: done(Standard_False),
|
||||
dmin(0),
|
||||
dmax(0),
|
||||
tol3d(0.0),
|
||||
tol2d(0.0),
|
||||
nbit(0),
|
||||
udeg(0),
|
||||
vdeg(0),
|
||||
knownp(Standard_False),
|
||||
tol3dreached(0.0),
|
||||
tol2dreached(0.0),
|
||||
paramtype(Approx_ChordLength),
|
||||
continuity(GeomAbs_C2)
|
||||
{
|
||||
critweights[0]=0.4;
|
||||
critweights[1]=0.2;
|
||||
critweights[2]=0.4;
|
||||
}
|
||||
AppBlend_AppSurf::AppBlend_AppSurf ():done(Standard_False) {}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@@ -80,21 +62,12 @@ AppBlend_AppSurf::AppBlend_AppSurf (const Standard_Integer Degmin,
|
||||
const Standard_Real Tol3d,
|
||||
const Standard_Real Tol2d,
|
||||
const Standard_Integer NbIt,
|
||||
const Standard_Boolean KnownParameters)
|
||||
: done(Standard_False),
|
||||
dmin(Degmin),
|
||||
dmax(Degmax),
|
||||
tol3d(Tol3d),
|
||||
tol2d(Tol2d),
|
||||
nbit(NbIt),
|
||||
udeg(0),
|
||||
vdeg(0),
|
||||
knownp(KnownParameters),
|
||||
tol3dreached(0.0),
|
||||
tol2dreached(0.0),
|
||||
paramtype(Approx_ChordLength),
|
||||
continuity(GeomAbs_C2)
|
||||
const Standard_Boolean KnownParameters):
|
||||
done(Standard_False),dmin(Degmin),dmax(Degmax),
|
||||
tol3d(Tol3d),tol2d(Tol2d),nbit(NbIt),knownp(KnownParameters)
|
||||
{
|
||||
continuity = GeomAbs_C2;
|
||||
paramtype = Approx_ChordLength;
|
||||
critweights[0]=0.4;
|
||||
critweights[1]=0.2;
|
||||
critweights[2]=0.4;
|
||||
|
@@ -54,16 +54,9 @@ AppDef_LinearCriteria::AppDef_LinearCriteria(const AppDef_MultiLine& SSP,
|
||||
const Standard_Integer FirstPoint,
|
||||
const Standard_Integer LastPoint):
|
||||
mySSP(SSP),
|
||||
myQuadraticWeight(0.0),
|
||||
myQualityWeight(0.0),
|
||||
myPntWeight(FirstPoint, LastPoint),
|
||||
myLength(0.0),
|
||||
myE(0),
|
||||
IF(0),
|
||||
IL(0)
|
||||
myE(0)
|
||||
{
|
||||
memset (myEstimation, 0, sizeof (myEstimation));
|
||||
memset (myPercent, 0, sizeof (myPercent));
|
||||
myPntWeight.Init(1.);
|
||||
}
|
||||
|
||||
@@ -360,73 +353,53 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min,
|
||||
// (critere sureleve => Non minimisation )
|
||||
|
||||
for(i = 0; i <= 2; i++)
|
||||
{
|
||||
if((ValCri[i] < 0.8 * myEstimation[i]) && (myEstimation[i] > JEsMin[i])) {
|
||||
if(ICDANA < 1) ICDANA = 1;
|
||||
if(ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2;
|
||||
myEstimation[i] = Max(1.05*ValCri[i], JEsMin[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// (3) Mise a jours des Estimation
|
||||
// (critere sous-estimer => mauvais conditionement)
|
||||
if (ValCri[0] > myEstimation[0] * 2)
|
||||
{
|
||||
myEstimation[0] += ValCri[0] * .1;
|
||||
if (ICDANA == 0)
|
||||
{
|
||||
if (ValCri[0] > myEstimation[0] * 10)
|
||||
{
|
||||
ICDANA = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 1;
|
||||
}
|
||||
|
||||
if (ValCri[0] > myEstimation[0] * 2) {
|
||||
myEstimation[0] += ValCri[0] * .1;
|
||||
if (ICDANA == 0) {
|
||||
if (ValCri[0] > myEstimation[0] * 10) {
|
||||
ICDANA = 2;
|
||||
}
|
||||
else ICDANA = 1;
|
||||
}
|
||||
else {
|
||||
ICDANA = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 2;
|
||||
if (ValCri[1] > myEstimation[1] * 20) {
|
||||
myEstimation[1] += ValCri[1] * .1;
|
||||
if (ICDANA == 0) {
|
||||
if (ValCri[1] > myEstimation[1] * 100) {
|
||||
ICDANA = 2;
|
||||
}
|
||||
else ICDANA = 1;
|
||||
}
|
||||
else {
|
||||
ICDANA = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ValCri[1] > myEstimation[1] * 20)
|
||||
{
|
||||
myEstimation[1] += ValCri[1] * .1;
|
||||
if (ICDANA == 0)
|
||||
{
|
||||
if (ValCri[1] > myEstimation[1] * 100)
|
||||
{
|
||||
ICDANA = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 1;
|
||||
}
|
||||
if (ValCri[2] > myEstimation[2] * 20) {
|
||||
myEstimation[2] += ValCri[2] * .05;
|
||||
if (ICDANA == 0) {
|
||||
if (ValCri[2] > myEstimation[2] * 100) {
|
||||
ICDANA = 2;
|
||||
}
|
||||
else ICDANA = 1;
|
||||
}
|
||||
else {
|
||||
ICDANA = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 2;
|
||||
}
|
||||
}
|
||||
if (ValCri[2] > myEstimation[2] * 20)
|
||||
{
|
||||
myEstimation[2] += ValCri[2] * .05;
|
||||
if (ICDANA == 0)
|
||||
{
|
||||
if (ValCri[2] > myEstimation[2] * 100)
|
||||
{
|
||||
ICDANA = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ICDANA = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ICDANA;
|
||||
}
|
||||
|
@@ -16,11 +16,7 @@
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
|
||||
AppParCurves_ConstraintCouple::
|
||||
AppParCurves_ConstraintCouple()
|
||||
: myIndex(-1),
|
||||
myConstraint(AppParCurves_NoConstraint)
|
||||
{
|
||||
}
|
||||
AppParCurves_ConstraintCouple() {}
|
||||
|
||||
|
||||
AppParCurves_ConstraintCouple::
|
||||
|
@@ -58,11 +58,7 @@ AppParCurves_Gradient::
|
||||
const Standard_Real Tol3d,
|
||||
const Standard_Real Tol2d,
|
||||
const Standard_Integer NbIterations):
|
||||
ParError(FirstPoint, LastPoint,0.0),
|
||||
AvError(0.0),
|
||||
MError3d(0.0),
|
||||
MError2d(0.0)
|
||||
{
|
||||
ParError(FirstPoint, LastPoint,0.0) {
|
||||
|
||||
// Standard_Boolean grad = Standard_True;
|
||||
Standard_Integer j, k, i2, l;
|
||||
|
@@ -46,10 +46,7 @@ static Standard_Integer ComputeDegree(const TColStd_Array1OfInteger& mults,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve()
|
||||
: myDegree(0)
|
||||
{
|
||||
}
|
||||
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve() {}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@@ -59,8 +56,7 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve()
|
||||
|
||||
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve
|
||||
(const Standard_Integer NbPol):
|
||||
AppParCurves_MultiCurve(NbPol),
|
||||
myDegree(0)
|
||||
AppParCurves_MultiCurve(NbPol)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -25,11 +25,7 @@
|
||||
#define tabPoint Handle(TColgp_HArray1OfPnt)::DownCast (ttabPoint)
|
||||
#define tabPoint2d Handle(TColgp_HArray1OfPnt2d)::DownCast (ttabPoint2d)
|
||||
|
||||
AppParCurves_MultiPoint::AppParCurves_MultiPoint()
|
||||
: nbP(0),
|
||||
nbP2d(0)
|
||||
{
|
||||
}
|
||||
AppParCurves_MultiPoint::AppParCurves_MultiPoint() {}
|
||||
|
||||
|
||||
AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles,
|
||||
|
@@ -56,9 +56,6 @@ const AppParCurves_Constraint LastC)
|
||||
myInvOrder = Standard_True;
|
||||
myHangChecking = Standard_True;
|
||||
alldone = Standard_False;
|
||||
tolreached = Standard_False;
|
||||
currenttol3d = 0.0;
|
||||
currenttol2d = 0.0;
|
||||
Perform(Line);
|
||||
}
|
||||
|
||||
@@ -87,9 +84,6 @@ const AppParCurves_Constraint LastC)
|
||||
myMaxSegments = MAXSEGM;
|
||||
myInvOrder = Standard_True;
|
||||
myHangChecking = Standard_True;
|
||||
tolreached = Standard_False;
|
||||
currenttol3d = 0.0;
|
||||
currenttol2d = 0.0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -133,8 +133,6 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
|
||||
const GeomAbs_Shape Order,
|
||||
const Standard_Integer MaxDegree,
|
||||
const Standard_Integer MaxSegments)
|
||||
: myMaxError2d1(0.0),
|
||||
myMaxError2d2(0.0)
|
||||
{
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
t_total = t_init = t_approx = t_uparam = 0;
|
||||
|
@@ -329,9 +329,7 @@ static Standard_Boolean NonSingularProcessing(const gp_Vec& theDU,
|
||||
//--------------------------------------------------------------------------------
|
||||
ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const TheISurface& ISurf
|
||||
,const ThePSurface& PSurf):
|
||||
MyIsTangent(Standard_False),
|
||||
MyHasBeenComputed(Standard_False),
|
||||
MyIsTangentbis(Standard_False),
|
||||
MyHasBeenComputedbis(Standard_False),
|
||||
MyImplicitFirst(Standard_True),
|
||||
MyZerImpFunc(PSurf,ISurf)
|
||||
@@ -340,9 +338,7 @@ ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const TheISurface& ISurf
|
||||
//--------------------------------------------------------------------------------
|
||||
ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const ThePSurface& PSurf
|
||||
,const TheISurface& ISurf):
|
||||
MyIsTangent(Standard_False),
|
||||
MyHasBeenComputed(Standard_False),
|
||||
MyIsTangentbis(Standard_False),
|
||||
MyHasBeenComputedbis(Standard_False),
|
||||
MyImplicitFirst(Standard_False),
|
||||
MyZerImpFunc(PSurf,ISurf)
|
||||
|
@@ -29,9 +29,7 @@
|
||||
//--------------------------------------------------------------------------------
|
||||
ApproxInt_PrmPrmSvSurfaces::ApproxInt_PrmPrmSvSurfaces( const ThePSurface& Surf1
|
||||
,const ThePSurface& Surf2):
|
||||
MyIsTangent(Standard_False),
|
||||
MyHasBeenComputed(Standard_False),
|
||||
MyIsTangentbis(Standard_False),
|
||||
MyHasBeenComputedbis(Standard_False),
|
||||
MyIntersectionOn2S(Surf1,Surf2,TOLTANGENCY)
|
||||
{
|
||||
|
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <Aspect_Background.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
//-Aliases
|
||||
//-Global data definitions
|
||||
@@ -57,14 +56,3 @@ Quantity_Color Aspect_Background::Color () const {
|
||||
return (MyColor);
|
||||
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_Background)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
|
||||
}
|
||||
|
@@ -46,9 +46,6 @@ public:
|
||||
|
||||
//! Returns the colour of the window background <me>.
|
||||
Standard_EXPORT Quantity_Color Color() const;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
|
||||
|
||||
|
@@ -140,20 +140,3 @@ void Aspect_CircularGrid::Init () {
|
||||
myAlpha = M_PI / Standard_Real(myDivisionNumber);
|
||||
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
|
||||
}
|
||||
|
@@ -55,9 +55,6 @@ public:
|
||||
Standard_EXPORT Standard_Integer DivisionNumber() const;
|
||||
|
||||
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -18,8 +18,6 @@
|
||||
#include <Aspect_GenId.hxx>
|
||||
#include <Aspect_IdentDefinitionError.hxx>
|
||||
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Aspect_GenId
|
||||
// purpose :
|
||||
@@ -116,21 +114,3 @@ Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
|
||||
theId = myLowerBound + myLength - myFreeCount - 1;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
|
||||
|
||||
for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
|
||||
{
|
||||
Standard_Integer aFreeId = anIter.Value();
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
|
||||
}
|
||||
}
|
||||
|
@@ -72,9 +72,6 @@ public:
|
||||
|
||||
//! Returns the upper identifier in range.
|
||||
Standard_Integer Upper() const { return myUpperBound; }
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -55,18 +55,3 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
|
||||
{
|
||||
return MyGradientMethod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_GradientBackground)
|
||||
|
||||
Quantity_Color aColor = Color();
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aColor)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
|
||||
}
|
||||
|
@@ -51,9 +51,6 @@ public:
|
||||
|
||||
//! Returns the current gradient background fill mode.
|
||||
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
|
||||
|
||||
|
@@ -104,22 +104,3 @@ void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
|
||||
myDrawMode = theDrawMode;
|
||||
UpdateDisplay();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
|
||||
}
|
||||
|
@@ -96,9 +96,6 @@ public:
|
||||
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
|
||||
|
||||
Standard_EXPORT virtual void Init() = 0;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -155,25 +155,3 @@ Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
|
||||
const Standard_Real beta) const {
|
||||
return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
|
||||
}
|
||||
|
@@ -67,9 +67,6 @@ public:
|
||||
Standard_EXPORT Standard_Real SecondAngle() const;
|
||||
|
||||
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -92,18 +92,3 @@ void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
|
||||
{
|
||||
MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
|
||||
}
|
||||
|
@@ -114,9 +114,6 @@ public:
|
||||
//! on platforms implementing thread-unsafe connections to display.
|
||||
//! NULL can be passed instead otherwise.
|
||||
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
|
||||
|
||||
|
@@ -357,7 +357,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
aChecker.SetNonDestructive(Standard_True);
|
||||
aChecker.SetRunParallel(myRunParallel);
|
||||
aChecker.SetFuzzyValue(myFuzzyValue);
|
||||
aChecker.SetProgressIndicator(*myProgressScope);
|
||||
aChecker.SetProgressIndicator(myProgressIndicator);
|
||||
//
|
||||
aChecker.Perform();
|
||||
Standard_Boolean hasError = aChecker.HasErrors();
|
||||
|
@@ -388,7 +388,7 @@ void BOPAlgo_BOP::Perform()
|
||||
pPF=new BOPAlgo_PaveFiller(aAllocator);
|
||||
pPF->SetArguments(aLS);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
pPF->SetProgressIndicator(myProgressIndicator);
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@@ -195,7 +195,7 @@ void BOPAlgo_Builder::Perform()
|
||||
//
|
||||
pPF->SetArguments(myArguments);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
pPF->SetProgressIndicator(myProgressIndicator);
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
@@ -632,7 +632,7 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
|
||||
aBS.SetRunParallel(myRunParallel);
|
||||
aBS.SetContext(myContext);
|
||||
aBS.SetFuzzyValue(myFuzzyValue);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
aBS.SetProgressIndicator(myProgressIndicator);
|
||||
aBS.Perform();
|
||||
|
||||
// Resulting solids
|
||||
|
@@ -438,7 +438,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
aBF.SetFace(aF);
|
||||
aBF.SetShapes(aLE);
|
||||
aBF.SetRunParallel(myRunParallel);
|
||||
aBF.SetProgressIndicator(*myProgressScope);
|
||||
aBF.SetProgressIndicator(myProgressIndicator);
|
||||
//
|
||||
}// for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
@@ -625,7 +625,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
||||
aPSB.Shape1() = aF1;
|
||||
aPSB.Shape2() = aF2;
|
||||
aPSB.SetFuzzyValue(myFuzzyValue);
|
||||
aPSB.SetProgressIndicator(*myProgressScope);
|
||||
aPSB.SetProgressIndicator(myProgressIndicator);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,7 @@ void BOPAlgo_Builder::FillInternalVertices()
|
||||
aVFI.SetVertex(aV);
|
||||
aVFI.SetFace(aFIm);
|
||||
aVFI.SetFuzzyValue(myFuzzyValue);
|
||||
aVFI.SetProgressIndicator(*myProgressScope);
|
||||
aVFI.SetProgressIndicator(myProgressIndicator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -432,7 +432,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
|
||||
aBS.SetSolid(aSolid);
|
||||
aBS.SetShapes(aSFS);
|
||||
aBS.SetRunParallel(myRunParallel);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
aBS.SetProgressIndicator(myProgressIndicator);
|
||||
}//for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
Standard_Integer k, aNbBS;
|
||||
|
@@ -432,7 +432,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
|
||||
aFaceSelfIntersect.SetFace(aF);
|
||||
aFaceSelfIntersect.SetTolF(aTolF);
|
||||
//
|
||||
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
|
||||
aFaceSelfIntersect.SetProgressIndicator(myProgressIndicator);
|
||||
}
|
||||
|
||||
Standard_Integer aNbFace = aVFace.Length();
|
||||
|
@@ -86,7 +86,7 @@ void BOPAlgo_MakerVolume::Perform()
|
||||
}
|
||||
//
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
pPF->SetProgressIndicator(myProgressIndicator);
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@@ -15,9 +15,8 @@
|
||||
|
||||
#include <BOPAlgo_Options.hxx>
|
||||
#include <Message_MsgFile.hxx>
|
||||
#include <Message_ProgressScope.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
@@ -52,7 +51,6 @@ BOPAlgo_Options::BOPAlgo_Options()
|
||||
myReport(new Message_Report),
|
||||
myRunParallel(myGlobalRunParallel),
|
||||
myFuzzyValue(Precision::Confusion()),
|
||||
myProgressScope(0L),
|
||||
myUseOBB(Standard_False)
|
||||
{
|
||||
BOPAlgo_LoadMessages();
|
||||
@@ -69,7 +67,6 @@ BOPAlgo_Options::BOPAlgo_Options
|
||||
myReport(new Message_Report),
|
||||
myRunParallel(myGlobalRunParallel),
|
||||
myFuzzyValue(Precision::Confusion()),
|
||||
myProgressScope(0L),
|
||||
myUseOBB(Standard_False)
|
||||
{
|
||||
BOPAlgo_LoadMessages();
|
||||
@@ -135,21 +132,22 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Options::SetProgressIndicator
|
||||
(const Message_ProgressScope& theScope)
|
||||
(const Handle(Message_ProgressIndicator)& theObj)
|
||||
{
|
||||
myProgressScope = &theScope;
|
||||
if (!theObj.IsNull()) {
|
||||
myProgressIndicator = theObj;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UserBreak
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Options::UserBreak() const
|
||||
{
|
||||
if (!myProgressScope) {
|
||||
if (myProgressIndicator.IsNull()) {
|
||||
return;
|
||||
}
|
||||
if (myProgressScope->UserBreak()) {
|
||||
if (myProgressIndicator->UserBreak()) {
|
||||
throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
|
||||
class Message_ProgressScope;
|
||||
class Message_ProgressIndicator;
|
||||
|
||||
//! The class provides the following options for the algorithms in Boolean Component:
|
||||
//! - *Memory allocation tool* - tool for memory allocations;
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
//!@name Progress indicator
|
||||
|
||||
//! Set the Progress Indicator object.
|
||||
Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
|
||||
Standard_EXPORT void SetProgressIndicator(const Handle(Message_ProgressIndicator)& theObj);
|
||||
|
||||
public:
|
||||
//!@name Usage of Oriented Bounding boxes
|
||||
@@ -185,7 +185,7 @@ protected:
|
||||
Handle(Message_Report) myReport;
|
||||
Standard_Boolean myRunParallel;
|
||||
Standard_Real myFuzzyValue;
|
||||
const Message_ProgressScope* myProgressScope;
|
||||
Handle(Message_ProgressIndicator) myProgressIndicator;
|
||||
Standard_Boolean myUseOBB;
|
||||
|
||||
};
|
||||
|
@@ -145,7 +145,8 @@ Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices
|
||||
Standard_Integer nV;
|
||||
if (nSD != -1) {
|
||||
// update old SD vertex with new value
|
||||
BRep_TVertex* aTVertex = static_cast<BRep_TVertex*>(aVSD.TShape().get());
|
||||
Handle(BRep_TVertex)& aTVertex =
|
||||
reinterpret_cast<Handle(BRep_TVertex)&>(const_cast<Handle(TopoDS_TShape)&>(aVSD.TShape()));
|
||||
aTVertex->Pnt(BRep_Tool::Pnt(aVn));
|
||||
aTVertex->Tolerance(BRep_Tool::Tolerance(aVn));
|
||||
aVn = aVSD;
|
||||
|
@@ -264,7 +264,7 @@ void BOPAlgo_PaveFiller::IntersectVE
|
||||
aVESolver.SetEdge(aE);
|
||||
aVESolver.SetPaveBlock(aPB);
|
||||
aVESolver.SetFuzzyValue(myFuzzyValue);
|
||||
aVESolver.SetProgressIndicator(*myProgressScope);
|
||||
aVESolver.SetProgressIndicator(myProgressIndicator);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user