mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
44 Commits
CR30892_1
...
IR-2020-09
Author | SHA1 | Date | |
---|---|---|---|
|
88610dfc0e | ||
|
0784d6e3cb | ||
|
897aeb207f | ||
|
b95caec47d | ||
|
7e785937b3 | ||
|
99289bed0a | ||
|
bf0114a372 | ||
|
183c99caf8 | ||
|
e0a25f3d93 | ||
|
c99ad5d760 | ||
|
59e11a2f75 | ||
|
dbab9c538c | ||
|
d9d03f10c3 | ||
|
c3e0e1de43 | ||
|
ed753e10df | ||
|
630ab53881 | ||
|
bbbb6bff1f | ||
|
6b63dc83c3 | ||
|
b19cde437e | ||
|
4637000015 | ||
|
60f7b22536 | ||
|
a516227511 | ||
|
f0da497005 | ||
|
ba8175dd5d | ||
|
129d6e8cc4 | ||
|
59af6f852a | ||
|
8f34d47e21 | ||
|
b3df3dcd82 | ||
|
992876e98f | ||
|
eca6e7c547 | ||
|
a75f5cdd86 | ||
|
b3da9c3ede | ||
|
17a5b56767 | ||
|
f5e758d239 | ||
|
cdddd079cc | ||
|
fba34cf8ba | ||
|
dda9303c69 | ||
|
7d47ebdbcd | ||
|
d6c489212b | ||
|
68a2329305 | ||
|
90bc1adb77 | ||
|
af7fa1438e | ||
|
6f04cbb1fb | ||
|
d99f0355e3 |
@@ -930,6 +930,9 @@ 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,19 +2,28 @@
|
||||
|
||||
# execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_BISON_EXECUTABLE)
|
||||
set (3RDPARTY_BISON_EXECUTABLE "" CACHE FILEPATH "The path to the bison command")
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
|
||||
find_package (BISON)
|
||||
|
||||
if (BISON_FOUND)
|
||||
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
|
||||
# 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)
|
||||
|
||||
if (NOT 3RDPARTY_BISON_EXECUTABLE OR NOT EXISTS "${3RDPARTY_BISON_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_BISON_EXECUTABLE)
|
||||
if (NOT BISON_FOUND OR NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED BISON_EXECUTABLE)
|
||||
endif()
|
@@ -2,19 +2,28 @@
|
||||
|
||||
# execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FLEX_EXECUTABLE)
|
||||
set (3RDPARTY_FLEX_EXECUTABLE "" CACHE FILEPATH "The Path to the flex command")
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
|
||||
find_package (FLEX)
|
||||
|
||||
if (FLEX_FOUND)
|
||||
set (3RDPARTY_FLEX_EXECUTABLE "${FLEX_EXECUTABLE}" CACHE FILEPATH "The Path to the flex command" FORCE)
|
||||
# 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)
|
||||
|
||||
if (NOT 3RDPARTY_FLEX_EXECUTABLE OR NOT EXISTS "${3RDPARTY_FLEX_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FLEX_EXECUTABLE)
|
||||
if (NOT FLEX_FOUND OR NOT FLEX_EXECUTABLE OR NOT EXISTS "${FLEX_EXECUTABLE}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_EXECUTABLE)
|
||||
endif()
|
@@ -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}")
|
||||
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}")
|
||||
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")
|
||||
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
|
||||
|
||||
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
|
||||
|
2
adm/scripts/.gitignore
vendored
Normal file
2
adm/scripts/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*custom.bat
|
||||
*custom.sh
|
234
adm/scripts/android_build.bat
Normal file
234
adm/scripts/android_build.bat
Normal file
@@ -0,0 +1,234 @@
|
||||
@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
|
31
adm/scripts/android_custom.bat.template
Normal file
31
adm/scripts/android_custom.bat.template
Normal file
@@ -0,0 +1,31 @@
|
||||
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
|
46
adm/scripts/cmake_custom.bat.template
Normal file
46
adm/scripts/cmake_custom.bat.template
Normal file
@@ -0,0 +1,46 @@
|
||||
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
|
42
adm/scripts/cmake_custom.sh.template
Normal file
42
adm/scripts/cmake_custom.sh.template
Normal file
@@ -0,0 +1,42 @@
|
||||
# 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=
|
83
adm/scripts/cmake_gen.bat
Normal file
83
adm/scripts/cmake_gen.bat
Normal file
@@ -0,0 +1,83 @@
|
||||
@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
|
86
adm/scripts/cmake_gen.sh
Executable file
86
adm/scripts/cmake_gen.sh
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/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
|
165
adm/scripts/wasm_build.bat
Normal file
165
adm/scripts/wasm_build.bat
Normal file
@@ -0,0 +1,165 @@
|
||||
@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
|
126
adm/scripts/wasm_build.sh
Executable file
126
adm/scripts/wasm_build.sh
Executable file
@@ -0,0 +1,126 @@
|
||||
#!/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
|
16
adm/scripts/wasm_custom.bat.template
Normal file
16
adm/scripts/wasm_custom.bat.template
Normal file
@@ -0,0 +1,16 @@
|
||||
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"
|
16
adm/scripts/wasm_custom.sh.template
Normal file
16
adm/scripts/wasm_custom.sh.template
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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,6 +21,7 @@ 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$")
|
||||
@@ -29,6 +30,10 @@ 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@")
|
||||
|
38
adm/templates/build.bat
Normal file
38
adm/templates/build.bat
Normal file
@@ -0,0 +1,38 @@
|
||||
@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
|
38
adm/templates/install.bat
Normal file
38
adm/templates/install.bat
Normal file
@@ -0,0 +1,38 @@
|
||||
@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,6 +71,7 @@ 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,6 +1935,118 @@ 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
|
||||
@@ -1980,6 +2092,10 @@ 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,40 +1542,38 @@ 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->Viewer());
|
||||
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (aViewer->StructureManager());
|
||||
aStruct->SetVisual (Graphic3d_TOS_SHADING); // Type of structure
|
||||
|
||||
// Create a group of primitives in this structure
|
||||
Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
|
||||
|
||||
Handle(Graphic3d_Group) aPrsGroup = aStruct->NewGroup();
|
||||
// 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_XnegYnegZneg, Quantity_NOC_WHITE);
|
||||
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (V3d_Zneg, Quantity_NOC_WHITE, true);
|
||||
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 ALL structures in this View
|
||||
aViewer->Viewer()->Display();
|
||||
// Display presentation in this View
|
||||
aStruct->Display();
|
||||
// Finally update the Visualization in this View
|
||||
aView->Update();
|
||||
// Fit view to object size
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// 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,6 +4,7 @@
|
||||
// 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>
|
||||
|
@@ -30,7 +30,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer )
|
||||
{
|
||||
Handle(Graphic3d_Group) aPrsGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aPrsGroup = thePrs->CurrentGroup();
|
||||
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);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
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 (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Text::Draw (aPresentation->CurrentGroup(),
|
||||
myDrawer->TextAspect(),
|
||||
myText,
|
||||
aTextPosition);
|
||||
|
@@ -214,7 +214,6 @@
|
||||
#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);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
myEndPnt,
|
||||
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
||||
anArrowAspect->Angle(),
|
||||
|
@@ -126,7 +126,6 @@
|
||||
#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);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(anArrow);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(anArrow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,19 +212,19 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
{
|
||||
case TopAbs_FORWARD: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_REVERSED: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_INTERNAL: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
thePresentation->CurrentGroup()->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: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
thePresentation->CurrentGroup()->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
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myForwardArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myForwardArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myReversedArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myReversedArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myInternalArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myInternalArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myExternalArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myExternalArray);
|
||||
}
|
||||
|
||||
//Method for advanced customizable selection of picked object
|
||||
@@ -275,8 +275,7 @@ void Sample2D_Face::HilightSelected
|
||||
aSelectionPrs->Clear();
|
||||
FillData();
|
||||
|
||||
Prs3d_Root::NewGroup ( aSelectionPrs );
|
||||
Handle (Graphic3d_Group) aSelectGroup = Prs3d_Root::CurrentGroup ( aSelectionPrs);
|
||||
Handle (Graphic3d_Group) aSelectGroup = aSelectionPrs->NewGroup();
|
||||
|
||||
for(Standard_Integer i=1; i<=aLength; ++i)
|
||||
{
|
||||
@@ -344,8 +343,7 @@ void Sample2D_Face::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationMana
|
||||
FillData();
|
||||
|
||||
//Direct highlighting
|
||||
Prs3d_Root::NewGroup ( aHighlightPrs );
|
||||
Handle (Graphic3d_Group) aHilightGroup = Prs3d_Root::CurrentGroup(aHighlightPrs);
|
||||
Handle (Graphic3d_Group) aHilightGroup = aHighlightPrs->NewGroup();
|
||||
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);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
|
||||
aPresentation->CurrentGroup()->SetGroupPrimitivesAspect(aMarker);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (myArrayOfPoints);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect(aMarker);
|
||||
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
|
||||
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,6 @@
|
||||
#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 = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_Group) mygroup = aPresentation->CurrentGroup();
|
||||
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
|
||||
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aOP);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aOP);
|
||||
|
||||
mygroup->SetGroupPrimitivesAspect(myAspect);
|
||||
}// end of the exploration of the shape in faces
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#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,7 +33,6 @@
|
||||
#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_OrFilter()),
|
||||
myFilters (new SelectMgr_AndOrFilter(SelectMgr_FilterType_OR)),
|
||||
myDefaultDrawer(new Prs3d_Drawer()),
|
||||
myCurDetected(0),
|
||||
myCurHighlighted(0),
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#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>
|
||||
@@ -46,7 +47,6 @@
|
||||
|
||||
class SelectMgr_SelectionManager;
|
||||
class V3d_Viewer;
|
||||
class SelectMgr_OrFilter;
|
||||
class V3d_View;
|
||||
class TopLoc_Location;
|
||||
class TCollection_ExtendedString;
|
||||
@@ -736,6 +736,15 @@ 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;
|
||||
|
||||
@@ -1332,14 +1341,7 @@ protected: //! @name internal methods
|
||||
if (myLastPicked.IsNull())
|
||||
return;
|
||||
|
||||
if (myLastPicked->IsAutoHilight())
|
||||
{
|
||||
myMainPM->ClearImmediateDraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
|
||||
}
|
||||
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
|
||||
}
|
||||
|
||||
//! Bind/Unbind status to object and its children
|
||||
@@ -1361,7 +1363,8 @@ protected: //! @name internal fields
|
||||
Handle(SelectMgr_EntityOwner) myLastPicked;
|
||||
Standard_Boolean myToHilightSelected;
|
||||
Handle(AIS_Selection) mySelection;
|
||||
Handle(SelectMgr_OrFilter) myFilters;
|
||||
Handle(SelectMgr_AndOrFilter) myFilters; //!< context filter (the content active filters
|
||||
//! can be applied with AND or OR operation)
|
||||
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) aStatus;
|
||||
if (!myObjects.Find (anInteractive, aStatus))
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -183,9 +183,9 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
anOwner->Unhilight (myMainPM);
|
||||
if (theIsToHilightSubIntensity)
|
||||
{
|
||||
if (aStatus->IsSubIntensityOn())
|
||||
if ((*aStatusPtr)->IsSubIntensityOn())
|
||||
{
|
||||
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
|
||||
const Standard_Integer aHiMode = getHilightMode (anInteractive, (*aStatusPtr)->HilightStyle(), (*aStatusPtr)->DisplayMode());
|
||||
highlightWithSubintensity (anOwner, aHiMode);
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
}
|
||||
if (anOwner == anInteractive->GlobalSelOwner())
|
||||
{
|
||||
aStatus->SetHilightStatus (Standard_False);
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
}
|
||||
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
|
||||
@@ -746,11 +746,15 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
continue;
|
||||
|
||||
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
|
||||
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (anOwner == anObj->GlobalSelOwner())
|
||||
{
|
||||
aState->SetHilightStatus (Standard_True);
|
||||
aState->SetHilightStyle (anObjSelStyle);
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_True);
|
||||
(*aStatusPtr)->SetHilightStyle (anObjSelStyle);
|
||||
}
|
||||
if (!anOwner->IsAutoHilight())
|
||||
{
|
||||
@@ -768,7 +772,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
}
|
||||
else
|
||||
{
|
||||
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
|
||||
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, (*aStatusPtr)->DisplayMode());
|
||||
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
|
||||
}
|
||||
}
|
||||
@@ -872,7 +876,10 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
if (aSelOwner == aSelectable->GlobalSelOwner())
|
||||
{
|
||||
myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
|
||||
if (Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable))
|
||||
{
|
||||
(*aStatusPtr)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -990,7 +997,12 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
if (myAutoHilight)
|
||||
{
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (theOwner->IsSelected())
|
||||
{
|
||||
highlightSelected (theOwner);
|
||||
@@ -1001,7 +1013,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
anOwners.Append (theOwner);
|
||||
unhighlightOwners (anOwners);
|
||||
|
||||
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#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,6 +56,20 @@ 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,12 +18,14 @@
|
||||
#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.
|
||||
@@ -103,6 +105,21 @@ 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,7 +21,6 @@
|
||||
#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>
|
||||
@@ -640,6 +639,44 @@ 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 :
|
||||
@@ -1213,7 +1250,8 @@ void AIS_Manipulator::Disk::Init (const Standard_ShortReal theInnerRadius,
|
||||
gp_Ax3 aSystem (myPosition.Location(), myPosition.Direction());
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation (aSystem, gp_Ax3());
|
||||
aTool.FillArray (myArray, myTriangulation, aTrsf);
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1232,7 +1270,8 @@ 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));
|
||||
aTool.FillArray (myArray, myTriangulation, aTrsf);
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1268,24 +1307,24 @@ void AIS_Manipulator::Cube::Init (const gp_Ax1& thePosition, const Standard_Shor
|
||||
addTriangle (1, aBottomLeft, aV3, aV4, -thePosition.Direction());
|
||||
|
||||
// Front
|
||||
addTriangle (2, aV3, aV4, aV5, aFront);
|
||||
addTriangle (3, aV3, aV5, aTopRight, aFront);
|
||||
addTriangle (2, aV3, aV5, aV4, -aFront);
|
||||
addTriangle (3, aV3, aTopRight, aV5, -aFront);
|
||||
|
||||
// Back
|
||||
addTriangle (4, aBottomLeft, aV2, aV7, -aFront);
|
||||
addTriangle (5, aBottomLeft, aV7, aV6, -aFront);
|
||||
addTriangle (4, aBottomLeft, aV7, aV2, aFront);
|
||||
addTriangle (5, aBottomLeft, aV6, aV7, aFront);
|
||||
|
||||
// aTop
|
||||
addTriangle (6, aV7, aV6, aV5, thePosition.Direction());
|
||||
addTriangle (7, aTopRight, aV7, aV5, thePosition.Direction());
|
||||
|
||||
//Left
|
||||
addTriangle (8, aV6, aV5, aV4, -aRight);
|
||||
addTriangle (9, aBottomLeft, aV6, aV4, -aRight);
|
||||
// Left
|
||||
addTriangle (8, aV6, aV4, aV5, aRight);
|
||||
addTriangle (9, aBottomLeft, aV4, aV6, aRight);
|
||||
|
||||
// Right
|
||||
addTriangle (10, aV3, aTopRight, aV7, aRight);
|
||||
addTriangle (11, aV3, aV7, aV2, aRight);
|
||||
addTriangle (10, aV3, aV7, aTopRight, -aRight);
|
||||
addTriangle (11, aV3, aV2, aV7, -aRight);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1322,7 +1361,8 @@ 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());
|
||||
aTool.FillArray(myArray, myTriangulation, aTrsf);
|
||||
myArray = aTool.CreateTriangulation (aTrsf);
|
||||
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1374,7 +1414,8 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myAxisRadius * 1.5,
|
||||
anArrowLength,
|
||||
myFacettesNumber);
|
||||
myTranslatorGroup = thePrs->NewGroup ();
|
||||
myTranslatorGroup = thePrs->NewGroup();
|
||||
myTranslatorGroup->SetClosed (true);
|
||||
myTranslatorGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myTranslatorGroup->AddPrimitiveArray (myTriangleArray);
|
||||
|
||||
@@ -1387,7 +1428,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightTranslator->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightTranslator);
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightTranslator->CurrentGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myTriangleArray);
|
||||
}
|
||||
@@ -1398,7 +1439,8 @@ 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 = thePrs->NewGroup();
|
||||
myScalerGroup->SetClosed (true);
|
||||
myScalerGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myScalerGroup->AddPrimitiveArray (myCube.Array());
|
||||
|
||||
@@ -1411,7 +1453,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightScaler->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightScaler);
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightScaler->CurrentGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myCube.Array());
|
||||
}
|
||||
@@ -1434,7 +1476,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightRotator->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightRotator);
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightRotator->CurrentGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
aGroup->AddPrimitiveArray (myCircle.Array());
|
||||
}
|
||||
@@ -1466,7 +1508,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myHighlightDragger->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(myHighlightDragger);
|
||||
Handle(Graphic3d_Group) aGroup = myHighlightDragger->CurrentGroup();
|
||||
aGroup->SetGroupPrimitivesAspect(aFillArea);
|
||||
aGroup->AddPrimitiveArray(mySector.Array());
|
||||
}
|
||||
|
@@ -163,6 +163,20 @@ 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 = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
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 = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
TheGroup->SetPrimitivesAspect (myHilightDrawer->PointAspect()->Aspect());
|
||||
Handle(Graphic3d_ArrayOfPoints) aPoint = new Graphic3d_ArrayOfPoints (1);
|
||||
aPoint->AddVertex (myComponent->X(),myComponent->Y(),myComponent->Z());
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#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,7 +24,6 @@
|
||||
#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>
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#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,6 +20,7 @@
|
||||
#include <Font_Rect.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_RenderingParams.hxx>
|
||||
#include <Graphic3d_Text.hxx>
|
||||
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
@@ -299,7 +300,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
if (myHasFlipping)
|
||||
{
|
||||
gp_Ax2 aFlippingAxes (aCenterOfLabel, myOrientation3D.Direction(), myOrientation3D.XDirection());
|
||||
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
thePrs->CurrentGroup()->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
}
|
||||
gp_Ax2 anOrientation = myOrientation3D;
|
||||
anOrientation.SetLocation (aPosition);
|
||||
@@ -308,15 +309,19 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
{
|
||||
aHasOwnAnchor = Standard_False; // always not using own anchor if flipping
|
||||
}
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, anOrientation, aHasOwnAnchor);
|
||||
Handle(Graphic3d_Text) aText =
|
||||
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, anOrientation, aHasOwnAnchor);
|
||||
aText->SetTextFormatter (myFormatter);
|
||||
if (myHasFlipping && isInit)
|
||||
{
|
||||
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||
thePrs->CurrentGroup()->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, aPosition);
|
||||
Handle(Graphic3d_Text) aText =
|
||||
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, aPosition);
|
||||
aText->SetTextFormatter (myFormatter);
|
||||
}
|
||||
|
||||
if (isInit)
|
||||
@@ -328,7 +333,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 = Prs3d_Root::CurrentGroup (thePrs)->ChangeBoundingBox();
|
||||
Graphic3d_BndBox4f& aBox = thePrs->CurrentGroup()->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,6 +24,8 @@
|
||||
#include <Font_FontAspect.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
class Font_TextFormatter;
|
||||
|
||||
//! Presentation of the text.
|
||||
class AIS_TextLabel : public AIS_InteractiveObject
|
||||
{
|
||||
@@ -121,6 +123,12 @@ 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
|
||||
@@ -144,6 +152,8 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Font_TextFormatter) myFormatter;
|
||||
|
||||
TCollection_ExtendedString myText;
|
||||
gp_Ax2 myOrientation3D;
|
||||
Standard_Boolean myHasOrientation3D;
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#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_DisplayMode.hxx>
|
||||
#include <AIS_Triangulation.hxx>
|
||||
|
||||
#include <AIS_DisplayMode.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 = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
|
||||
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 = Prs3d_Root::CurrentGroup (aPresentation);
|
||||
Handle(Graphic3d_Group) aGroup = aPresentation->CurrentGroup();
|
||||
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 = Prs3d_Root::NewGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
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 = Prs3d_Root::NewGroup (thePrs);
|
||||
Handle(Graphic3d_Group) anAxisGroup = thePrs->NewGroup();
|
||||
myPartToGroup.Bind (aPart, anAxisGroup);
|
||||
if (isShadingMode)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
Handle(Graphic3d_Group) anArrowGroup = thePrs->NewGroup();
|
||||
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 = Prs3d_Root::NewGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aLabelGroup = thePrs->NewGroup();
|
||||
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 = Prs3d_Root::NewGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
myPartToGroup.Bind (aPart, aGroup);
|
||||
|
||||
aGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <AIS_AnimationCamera.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Manipulator.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_RubberBand.hxx>
|
||||
#include <AIS_XRTrackedDevice.hxx>
|
||||
@@ -2611,19 +2610,20 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
case AIS_DragAction_Start:
|
||||
{
|
||||
myDragObject.Nullify();
|
||||
myDragOwner.Nullify();
|
||||
if (!theCtx->HasDetected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveObject) aPrs = theCtx->DetectedInteractive();
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (aPrs))
|
||||
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))
|
||||
{
|
||||
if (aManip->HasActiveMode())
|
||||
{
|
||||
myDragObject = aManip;
|
||||
aManip->StartTransform (myGL.Dragging.PointStart.x(), myGL.Dragging.PointStart.y(), theView);
|
||||
}
|
||||
myDragObject = aDetectedPrs;
|
||||
myDragOwner = aDetectedOwner;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2638,10 +2638,9 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
{
|
||||
theCtx->SetSelectedState (aGlobOwner, true);
|
||||
}
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
|
||||
{
|
||||
aManip->Transform (myGL.Dragging.PointTo.x(), myGL.Dragging.PointTo.y(), theView);
|
||||
}
|
||||
|
||||
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction);
|
||||
theView->Invalidate();
|
||||
return;
|
||||
}
|
||||
@@ -2655,10 +2654,8 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
|
||||
myGL.Dragging.PointTo = myGL.Dragging.PointStart;
|
||||
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
|
||||
|
||||
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
|
||||
{
|
||||
aManip->StopTransform (false);
|
||||
}
|
||||
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
|
||||
myGL.Dragging.PointTo, theAction);
|
||||
Standard_FALLTHROUGH
|
||||
}
|
||||
case AIS_DragAction_Stop:
|
||||
@@ -2673,8 +2670,11 @@ 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,6 +40,7 @@ class AIS_Point;
|
||||
class AIS_RubberBand;
|
||||
class AIS_XRTrackedDevice;
|
||||
class Graphic3d_Camera;
|
||||
class SelectMgr_EntityOwner;
|
||||
class V3d_View;
|
||||
class WNT_HIDSpaceMouse;
|
||||
|
||||
@@ -737,6 +738,7 @@ 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,7 +24,6 @@
|
||||
#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>
|
||||
@@ -599,6 +598,7 @@ 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,6 +621,7 @@ 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());
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <Aspect_Background.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
//-Aliases
|
||||
//-Global data definitions
|
||||
@@ -56,3 +57,14 @@ 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,6 +46,9 @@ 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,3 +140,20 @@ 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,6 +55,9 @@ 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,6 +18,8 @@
|
||||
#include <Aspect_GenId.hxx>
|
||||
#include <Aspect_IdentDefinitionError.hxx>
|
||||
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Aspect_GenId
|
||||
// purpose :
|
||||
@@ -114,3 +116,21 @@ 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,6 +72,9 @@ 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,3 +55,18 @@ 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,6 +51,9 @@ 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,3 +104,22 @@ 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,6 +96,9 @@ 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,3 +155,25 @@ 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,6 +67,9 @@ 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,3 +92,18 @@ 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,6 +114,9 @@ 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(myProgressIndicator);
|
||||
aChecker.SetProgressIndicator(*myProgressScope);
|
||||
//
|
||||
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(myProgressIndicator);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
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(myProgressIndicator);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
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(myProgressIndicator);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
aBS.Perform();
|
||||
|
||||
// Resulting solids
|
||||
|
@@ -438,7 +438,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
aBF.SetFace(aF);
|
||||
aBF.SetShapes(aLE);
|
||||
aBF.SetRunParallel(myRunParallel);
|
||||
aBF.SetProgressIndicator(myProgressIndicator);
|
||||
aBF.SetProgressIndicator(*myProgressScope);
|
||||
//
|
||||
}// 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(myProgressIndicator);
|
||||
aPSB.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,7 @@ void BOPAlgo_Builder::FillInternalVertices()
|
||||
aVFI.SetVertex(aV);
|
||||
aVFI.SetFace(aFIm);
|
||||
aVFI.SetFuzzyValue(myFuzzyValue);
|
||||
aVFI.SetProgressIndicator(myProgressIndicator);
|
||||
aVFI.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -432,7 +432,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
|
||||
aBS.SetSolid(aSolid);
|
||||
aBS.SetShapes(aSFS);
|
||||
aBS.SetRunParallel(myRunParallel);
|
||||
aBS.SetProgressIndicator(myProgressIndicator);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
}//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(myProgressIndicator);
|
||||
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
|
||||
Standard_Integer aNbFace = aVFace.Length();
|
||||
|
@@ -86,7 +86,7 @@ void BOPAlgo_MakerVolume::Perform()
|
||||
}
|
||||
//
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(myProgressIndicator);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@@ -15,8 +15,9 @@
|
||||
|
||||
#include <BOPAlgo_Options.hxx>
|
||||
#include <Message_MsgFile.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <Message_ProgressScope.hxx>
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
@@ -51,6 +52,7 @@ BOPAlgo_Options::BOPAlgo_Options()
|
||||
myReport(new Message_Report),
|
||||
myRunParallel(myGlobalRunParallel),
|
||||
myFuzzyValue(Precision::Confusion()),
|
||||
myProgressScope(0L),
|
||||
myUseOBB(Standard_False)
|
||||
{
|
||||
BOPAlgo_LoadMessages();
|
||||
@@ -67,6 +69,7 @@ BOPAlgo_Options::BOPAlgo_Options
|
||||
myReport(new Message_Report),
|
||||
myRunParallel(myGlobalRunParallel),
|
||||
myFuzzyValue(Precision::Confusion()),
|
||||
myProgressScope(0L),
|
||||
myUseOBB(Standard_False)
|
||||
{
|
||||
BOPAlgo_LoadMessages();
|
||||
@@ -132,22 +135,21 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Options::SetProgressIndicator
|
||||
(const Handle(Message_ProgressIndicator)& theObj)
|
||||
(const Message_ProgressScope& theScope)
|
||||
{
|
||||
if (!theObj.IsNull()) {
|
||||
myProgressIndicator = theObj;
|
||||
}
|
||||
myProgressScope = &theScope;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UserBreak
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Options::UserBreak() const
|
||||
{
|
||||
if (myProgressIndicator.IsNull()) {
|
||||
if (!myProgressScope) {
|
||||
return;
|
||||
}
|
||||
if (myProgressIndicator->UserBreak()) {
|
||||
if (myProgressScope->UserBreak()) {
|
||||
throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
|
||||
class Message_ProgressIndicator;
|
||||
class Message_ProgressScope;
|
||||
|
||||
//! 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 Handle(Message_ProgressIndicator)& theObj);
|
||||
Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
|
||||
|
||||
public:
|
||||
//!@name Usage of Oriented Bounding boxes
|
||||
@@ -185,7 +185,7 @@ protected:
|
||||
Handle(Message_Report) myReport;
|
||||
Standard_Boolean myRunParallel;
|
||||
Standard_Real myFuzzyValue;
|
||||
Handle(Message_ProgressIndicator) myProgressIndicator;
|
||||
const Message_ProgressScope* myProgressScope;
|
||||
Standard_Boolean myUseOBB;
|
||||
|
||||
};
|
||||
|
@@ -145,8 +145,7 @@ Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices
|
||||
Standard_Integer nV;
|
||||
if (nSD != -1) {
|
||||
// update old SD vertex with new value
|
||||
Handle(BRep_TVertex)& aTVertex =
|
||||
reinterpret_cast<Handle(BRep_TVertex)&>(const_cast<Handle(TopoDS_TShape)&>(aVSD.TShape()));
|
||||
BRep_TVertex* aTVertex = static_cast<BRep_TVertex*>(aVSD.TShape().get());
|
||||
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(myProgressIndicator);
|
||||
aVESolver.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
@@ -253,7 +253,7 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
|
||||
anEdgeEdge.SetBoxes (aBB1, aBB2);
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
}//for (; aIt2.More(); aIt2.Next()) {
|
||||
}//for (; aIt1.More(); aIt1.Next()) {
|
||||
}//for (; myIterator->More(); myIterator->Next()) {
|
||||
@@ -1073,7 +1073,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||
else
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -217,7 +217,7 @@ void BOPAlgo_PaveFiller::PerformVF()
|
||||
aVertexFace.SetVertex(aV);
|
||||
aVertexFace.SetFace(aF);
|
||||
aVertexFace.SetFuzzyValue(myFuzzyValue);
|
||||
aVertexFace.SetProgressIndicator(myProgressIndicator);
|
||||
aVertexFace.SetProgressIndicator(*myProgressScope);
|
||||
}//for (; myIterator->More(); myIterator->Next()) {
|
||||
//
|
||||
aNbVF=aVVF.Length();
|
||||
|
@@ -278,7 +278,7 @@ void BOPAlgo_PaveFiller::PerformEF()
|
||||
aSR = aPBRange;
|
||||
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
|
||||
aEdgeFace.SetRange (aPBRange);
|
||||
aEdgeFace.SetProgressIndicator(myProgressIndicator);
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
// Save the pair to avoid their forced intersection
|
||||
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
|
||||
if (!pMPB)
|
||||
@@ -999,7 +999,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
|
||||
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
|
||||
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
|
||||
aEdgeFace.SetProgressIndicator(myProgressIndicator);
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -306,7 +306,7 @@ void BOPAlgo_PaveFiller::PerformFF()
|
||||
//
|
||||
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
|
||||
aFaceFace.SetFuzzyValue(myFuzzyValue);
|
||||
aFaceFace.SetProgressIndicator(myProgressIndicator);
|
||||
aFaceFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
else {
|
||||
// for the Glue mode just add all interferences of that type
|
||||
@@ -1007,7 +1007,7 @@ void BOPAlgo_PaveFiller::PostTreatFF
|
||||
}
|
||||
//
|
||||
// 2 Fuse shapes
|
||||
aPF.SetProgressIndicator(myProgressIndicator);
|
||||
aPF.SetProgressIndicator(*myProgressScope);
|
||||
aPF.SetRunParallel(myRunParallel);
|
||||
aPF.SetArguments(aLS);
|
||||
aPF.Perform();
|
||||
@@ -3328,7 +3328,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
|
||||
Standard_Real aTolE = BRep_Tool::Tolerance(aE);
|
||||
if (aTolC < aTolE) {
|
||||
// reduce edge tolerance
|
||||
reinterpret_cast<BRep_TEdge*>(aE.TShape().operator->())->Tolerance(aTolC);
|
||||
static_cast<BRep_TEdge*>(aE.TShape().get())->Tolerance(aTolC);
|
||||
bIsReduced = Standard_True;
|
||||
}
|
||||
}
|
||||
@@ -3446,7 +3446,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
|
||||
}
|
||||
//
|
||||
if (aMaxTol < aTolV) {
|
||||
reinterpret_cast<BRep_TVertex*>(aV.TShape().operator->())->Tolerance(aMaxTol);
|
||||
static_cast<BRep_TVertex*>(aV.TShape().get())->Tolerance(aMaxTol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -484,7 +484,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
|
||||
aBSE.SetCommonBlock(aCB);
|
||||
}
|
||||
aBSE.SetDS(myDS);
|
||||
aBSE.SetProgressIndicator(myProgressIndicator);
|
||||
aBSE.SetProgressIndicator(*myProgressScope);
|
||||
} // for (; aItPB.More(); aItPB.Next()) {
|
||||
} // for (i=0; i<aNbPBP; ++i) {
|
||||
//
|
||||
@@ -596,7 +596,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
BOPAlgo_MPC& aMPC=aVMPC.Appended();
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aF1F);
|
||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
//
|
||||
// On
|
||||
@@ -660,7 +660,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aF1F);
|
||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}// for (i=0; i<aNbFI; ++i) {
|
||||
//
|
||||
@@ -710,7 +710,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aFf[m]);
|
||||
aMPC.SetFlag(Standard_True);
|
||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ void BOPAlgo_Splitter::Perform()
|
||||
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
|
||||
pPF->SetArguments(aLS);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(myProgressIndicator);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@@ -24,9 +24,8 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
#include <BOPAlgo_Options.hxx>
|
||||
class Message_ProgressIndicator;
|
||||
class TopoDS_Shape;
|
||||
|
||||
class TopoDS_Shape;
|
||||
|
||||
//! Provides the root interface for the API algorithms
|
||||
|
||||
|
@@ -125,7 +125,7 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
|
||||
myDSFiller->SetArguments(theArgs);
|
||||
// Set options for intersection
|
||||
myDSFiller->SetRunParallel(myRunParallel);
|
||||
myDSFiller->SetProgressIndicator(myProgressIndicator);
|
||||
myDSFiller->SetProgressIndicator(*myProgressScope);
|
||||
myDSFiller->SetFuzzyValue(myFuzzyValue);
|
||||
myDSFiller->SetNonDestructive(myNonDestructive);
|
||||
myDSFiller->SetGlue(myGlue);
|
||||
@@ -145,7 +145,7 @@ void BRepAlgoAPI_BuilderAlgo::BuildResult()
|
||||
{
|
||||
// Set options to the builder
|
||||
myBuilder->SetRunParallel(myRunParallel);
|
||||
myBuilder->SetProgressIndicator(myProgressIndicator);
|
||||
myBuilder->SetProgressIndicator(*myProgressScope);
|
||||
myBuilder->SetCheckInverted(myCheckInverted);
|
||||
myBuilder->SetToFillHistory(myFillHistory);
|
||||
// Perform building of the result with pre-calculated intersections
|
||||
|
@@ -94,7 +94,7 @@ void BRepAlgoAPI_Check::Perform()
|
||||
anAnalyzer.SelfInterMode() = myTestSI;
|
||||
// Set options from BOPAlgo_Options
|
||||
anAnalyzer.SetRunParallel(myRunParallel);
|
||||
anAnalyzer.SetProgressIndicator(myProgressIndicator);
|
||||
anAnalyzer.SetProgressIndicator(*myProgressScope);
|
||||
anAnalyzer.SetFuzzyValue(myFuzzyValue);
|
||||
// Perform the check
|
||||
anAnalyzer.Perform();
|
||||
|
@@ -85,8 +85,7 @@
|
||||
#include <GeomLib.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
#include <Message_ProgressScope.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
@@ -1812,10 +1811,10 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
|
||||
#include <OSD_Timer.hxx>
|
||||
#endif
|
||||
|
||||
void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::Perform(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
const Standard_Integer aNumberOfStages = myAnalysis + myCutting + mySewing + 2;
|
||||
Message_ProgressSentry aPS (thePI, "Sewing", 0, aNumberOfStages, 1);
|
||||
Message_ProgressScope aPS (theProgress, "Sewing", aNumberOfStages);
|
||||
#ifdef OCCT_DEBUG
|
||||
Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
|
||||
OSD_Chronometer chr_total, chr_local;
|
||||
@@ -1831,10 +1830,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
chr_local.Reset();
|
||||
chr_local.Start();
|
||||
#endif
|
||||
FaceAnalysis (thePI);
|
||||
FaceAnalysis (aPS.Next());
|
||||
if (!aPS.More())
|
||||
return;
|
||||
aPS.Next();
|
||||
#ifdef OCCT_DEBUG
|
||||
chr_local.Stop();
|
||||
chr_local.Show(t_analysis);
|
||||
@@ -1855,10 +1853,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
chr_local.Reset();
|
||||
chr_local.Start();
|
||||
#endif
|
||||
VerticesAssembling (thePI);
|
||||
VerticesAssembling (aPS.Next());
|
||||
if (!aPS.More())
|
||||
return;
|
||||
aPS.Next();
|
||||
#ifdef OCCT_DEBUG
|
||||
chr_local.Stop();
|
||||
chr_local.Show(t_assembling);
|
||||
@@ -1871,10 +1868,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
chr_local.Reset();
|
||||
chr_local.Start();
|
||||
#endif
|
||||
Cutting (thePI);
|
||||
Cutting (aPS.Next());
|
||||
if (!aPS.More())
|
||||
return;
|
||||
aPS.Next();
|
||||
#ifdef OCCT_DEBUG
|
||||
chr_local.Stop();
|
||||
chr_local.Show(t_cutting);
|
||||
@@ -1886,10 +1882,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
chr_local.Reset();
|
||||
chr_local.Start();
|
||||
#endif
|
||||
Merging (Standard_True, thePI);
|
||||
Merging (Standard_True, aPS.Next());
|
||||
if (!aPS.More())
|
||||
return;
|
||||
aPS.Next();
|
||||
#ifdef OCCT_DEBUG
|
||||
chr_local.Stop();
|
||||
chr_local.Show(t_merging);
|
||||
@@ -1898,10 +1893,10 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
}
|
||||
else
|
||||
{
|
||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
||||
aPS.Next();
|
||||
if (myCutting)
|
||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
||||
aPS.Next();
|
||||
aPS.Next();
|
||||
if (!aPS.More())
|
||||
return;
|
||||
}
|
||||
@@ -1913,7 +1908,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
std::cout << "Creating sewed shape..." << std::endl;
|
||||
#endif
|
||||
// examine the multiple edges if any and process sameparameter for edges if necessary
|
||||
EdgeProcessing (thePI);
|
||||
EdgeProcessing (aPS.Next());
|
||||
if (!aPS.More())
|
||||
return;
|
||||
CreateSewedShape();
|
||||
@@ -1923,7 +1918,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
||||
return;
|
||||
}
|
||||
|
||||
EdgeRegularity (thePI);
|
||||
EdgeRegularity (aPS.Next());
|
||||
|
||||
if (mySameParameterMode && myFaceMode)
|
||||
SameParameterShape();
|
||||
@@ -2235,7 +2230,7 @@ void BRepBuilderAPI_Sewing::Dump() const
|
||||
// myDegenerated
|
||||
//=======================================================================
|
||||
|
||||
void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
if (!myShape.IsNull() && myOldShapes.IsEmpty()) {
|
||||
Add(myShape);
|
||||
@@ -2246,7 +2241,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
|
||||
TopTools_MapOfShape SmallEdges;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape GluedVertices;
|
||||
Standard_Integer i = 1;
|
||||
Message_ProgressSentry aPS (thePI, "Shape analysis", 0, myOldShapes.Extent(), 1);
|
||||
Message_ProgressScope aPS (theProgress, "Shape analysis", myOldShapes.Extent());
|
||||
for (i = 1; i <= myOldShapes.Extent() && aPS.More(); i++, aPS.Next()) {
|
||||
for (TopExp_Explorer fexp(myOldShapes(i),TopAbs_FACE); fexp.More(); fexp.Next()) {
|
||||
|
||||
@@ -2777,7 +2772,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
|
||||
TopTools_DataMapOfShapeListOfShape& aNodeEdges,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aBoundFaces,
|
||||
const Standard_Real Tolerance,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
// Create map of node -> vertices
|
||||
TopTools_IndexedDataMapOfShapeListOfShape NodeVertices;
|
||||
@@ -2805,7 +2800,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
|
||||
#endif
|
||||
// Merge nearest nodes
|
||||
TopTools_IndexedDataMapOfShapeShape NodeNearestNode;
|
||||
Message_ProgressSentry aPS (theProgress, "Glueing nodes", 0, nbNodes, 1, Standard_True);
|
||||
Message_ProgressScope aPS (theProgress, "Glueing nodes", nbNodes, Standard_True);
|
||||
for (Standard_Integer i = 1; i <= nbNodes && aPS.More(); i++, aPS.Next()) {
|
||||
const TopoDS_Vertex& node1 = TopoDS::Vertex(NodeVertices.FindKey(i));
|
||||
// Find near nodes
|
||||
@@ -2938,11 +2933,11 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
|
||||
return CreateNewNodes(NodeNearestNode,NodeVertices,aVertexNode,aNodeEdges);
|
||||
}
|
||||
|
||||
void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::VerticesAssembling(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
Standard_Integer nbVert = myVertexNode.Extent();
|
||||
Standard_Integer nbVertFree = myVertexNodeFree.Extent();
|
||||
Message_ProgressSentry aPS (thePI, "Vertices assembling", 0, 2, 1);
|
||||
Message_ProgressScope aPS (theProgress, "Vertices assembling", 2);
|
||||
if (nbVert || nbVertFree) {
|
||||
// Fill map node -> sections
|
||||
Standard_Integer i;
|
||||
@@ -2964,16 +2959,15 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Assemble " << nbVert << " vertices on faces..." << std::endl;
|
||||
#endif
|
||||
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
|
||||
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, aPS.Next()));
|
||||
}
|
||||
if (!aPS.More())
|
||||
return;
|
||||
aPS.Next();
|
||||
if (nbVertFree) {
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Assemble " << nbVertFree << " vertices on floating edges..." << std::endl;
|
||||
#endif
|
||||
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, thePI));
|
||||
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, aPS.Next()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3133,11 +3127,11 @@ static void ReplaceEdge(const TopoDS_Shape& oldEdge,
|
||||
//=======================================================================
|
||||
|
||||
void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
|
||||
const Handle(Message_ProgressIndicator)& thePI)
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
BRep_Builder B;
|
||||
// TopTools_MapOfShape MergedEdges;
|
||||
Message_ProgressSentry aPS (thePI, "Merging bounds", 0, myBoundFaces.Extent(), 1);
|
||||
Message_ProgressScope aPS (theProgress, "Merging bounds", myBoundFaces.Extent());
|
||||
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||
|
||||
@@ -3623,7 +3617,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
|
||||
// myCuttingNode
|
||||
//=======================================================================
|
||||
|
||||
void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
Standard_Integer i, nbVertices = myVertexNode.Extent();
|
||||
if (!nbVertices) return;
|
||||
@@ -3646,7 +3640,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
|
||||
Standard_Real first, last;
|
||||
// Iterate on all boundaries
|
||||
Standard_Integer nbBounds = myBoundFaces.Extent();
|
||||
Message_ProgressSentry aPS (thePI, "Cutting bounds", 0, nbBounds, 1);
|
||||
Message_ProgressScope aPS (theProgress, "Cutting bounds", nbBounds);
|
||||
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||
const TopoDS_Edge& bound = TopoDS::Edge(anIterB.Key());
|
||||
@@ -3986,12 +3980,12 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_
|
||||
// - make the contigous edges sameparameter
|
||||
//=======================================================================
|
||||
|
||||
void BRepBuilderAPI_Sewing::EdgeProcessing(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::EdgeProcessing(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
// constructs sectionEdge
|
||||
TopTools_IndexedMapOfShape MapFreeEdges;
|
||||
TopTools_DataMapOfShapeShape EdgeFace;
|
||||
Message_ProgressSentry aPS (thePI, "Edge processing", 0, myBoundFaces.Extent(), 1);
|
||||
Message_ProgressScope aPS (theProgress, "Edge processing", myBoundFaces.Extent());
|
||||
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||
const TopoDS_Shape& bound = anIterB.Key();
|
||||
@@ -4051,12 +4045,12 @@ void BRepBuilderAPI_Sewing::EdgeProcessing(const Handle(Message_ProgressIndicato
|
||||
//purpose : update Continuity flag on newly created edges
|
||||
//=======================================================================
|
||||
|
||||
void BRepBuilderAPI_Sewing::EdgeRegularity(const Handle(Message_ProgressIndicator)& thePI)
|
||||
void BRepBuilderAPI_Sewing::EdgeRegularity(const Message_ProgressRange& theProgress)
|
||||
{
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapEF;
|
||||
TopExp::MapShapesAndAncestors(mySewedShape, TopAbs_EDGE, TopAbs_FACE, aMapEF);
|
||||
|
||||
Message_ProgressSentry aPS(thePI, "Encode edge regularity", 0, myMergedEdges.Extent(), 1);
|
||||
Message_ProgressScope aPS(theProgress, "Encode edge regularity", myMergedEdges.Extent());
|
||||
for (TopTools_MapIteratorOfMapOfShape aMEIt(myMergedEdges); aMEIt.More() && aPS.More(); aMEIt.Next(), aPS.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(myReShape->Apply(aMEIt.Value()));
|
||||
|
@@ -41,13 +41,12 @@
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <Message_ProgressRange.hxx>
|
||||
|
||||
class BRepTools_ReShape;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class Message_ProgressIndicator;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
@@ -105,8 +104,8 @@ public:
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& shape);
|
||||
|
||||
//! Computing
|
||||
//! thePI - progress indicator of algorithm
|
||||
Standard_EXPORT void Perform (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
//! theProgress - progress indicator of algorithm
|
||||
Standard_EXPORT void Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
//! Gives the sewed shape
|
||||
//! a null shape if nothing constructed
|
||||
@@ -248,10 +247,10 @@ protected:
|
||||
|
||||
|
||||
//! Performs cutting of sections
|
||||
//! thePI - progress indicator of processing
|
||||
Standard_EXPORT void Cutting (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
//! theProgress - progress indicator of processing
|
||||
Standard_EXPORT void Cutting (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
Standard_EXPORT void Merging (const Standard_Boolean passage, const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
Standard_EXPORT void Merging (const Standard_Boolean passage, const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsMergedClosed (const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const TopoDS_Face& fase) const;
|
||||
|
||||
@@ -262,10 +261,10 @@ protected:
|
||||
//! Merged nearest edges.
|
||||
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfBoolean& SeqMergedOri);
|
||||
|
||||
Standard_EXPORT void EdgeProcessing (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
Standard_EXPORT void EdgeProcessing (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
//! Recompute regularity on merged edges
|
||||
Standard_EXPORT void EdgeRegularity (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
Standard_EXPORT void EdgeRegularity (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
Standard_EXPORT void CreateOutputInformations();
|
||||
|
||||
@@ -277,8 +276,8 @@ protected:
|
||||
|
||||
|
||||
//! This method is called from Perform only
|
||||
//! thePI - progress indicator of processing
|
||||
Standard_EXPORT virtual void FaceAnalysis (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
//! theProgress - progress indicator of processing
|
||||
Standard_EXPORT virtual void FaceAnalysis (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
|
||||
//! This method is called from Perform only
|
||||
@@ -286,8 +285,8 @@ protected:
|
||||
|
||||
|
||||
//! This method is called from Perform only
|
||||
//! thePI - progress indicator of processing
|
||||
Standard_EXPORT virtual void VerticesAssembling (const Handle(Message_ProgressIndicator)& thePI = 0);
|
||||
//! theProgress - progress indicator of processing
|
||||
Standard_EXPORT virtual void VerticesAssembling (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
|
||||
//! This method is called from Perform only
|
||||
|
@@ -154,7 +154,7 @@ void BRepExtrema_DistShapeShape::DistanceMapMap (const TopTools_IndexedMapOfShap
|
||||
const TopoDS_Shape& aShape1 = theMap1 (aPair.Index1);
|
||||
const TopoDS_Shape& aShape2 = theMap2 (aPair.Index2);
|
||||
|
||||
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps, myFlag);
|
||||
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps);
|
||||
if (aDistTool.IsDone())
|
||||
{
|
||||
if (aDistTool.DistValue() < myDistRef - myEps)
|
||||
@@ -199,7 +199,8 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
|
||||
myEps (Precision::Confusion()),
|
||||
myIsInitS1 (Standard_False),
|
||||
myIsInitS2 (Standard_False),
|
||||
myFlag (Extrema_ExtFlag_MINMAX)
|
||||
myFlag (Extrema_ExtFlag_MINMAX),
|
||||
myAlgo (Extrema_ExtAlgo_Grad)
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -210,14 +211,16 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
|
||||
//=======================================================================
|
||||
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
|
||||
const TopoDS_Shape& Shape2,
|
||||
const Extrema_ExtFlag F)
|
||||
const Extrema_ExtFlag F,
|
||||
const Extrema_ExtAlgo A)
|
||||
: myDistRef (0.0),
|
||||
myIsDone (Standard_False),
|
||||
myInnerSol (Standard_False),
|
||||
myEps (Precision::Confusion()),
|
||||
myIsInitS1 (Standard_False),
|
||||
myIsInitS2 (Standard_False),
|
||||
myFlag (F)
|
||||
myFlag (F),
|
||||
myAlgo (A)
|
||||
{
|
||||
LoadS1(Shape1);
|
||||
LoadS2(Shape2);
|
||||
@@ -232,14 +235,16 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape
|
||||
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
|
||||
const TopoDS_Shape& Shape2,
|
||||
const Standard_Real theDeflection,
|
||||
const Extrema_ExtFlag F)
|
||||
const Extrema_ExtFlag F,
|
||||
const Extrema_ExtAlgo A)
|
||||
: myDistRef (0.0),
|
||||
myIsDone (Standard_False),
|
||||
myInnerSol (Standard_False),
|
||||
myEps (theDeflection),
|
||||
myIsInitS1 (Standard_False),
|
||||
myIsInitS2 (Standard_False),
|
||||
myFlag (F)
|
||||
myFlag (F),
|
||||
myAlgo (A)
|
||||
{
|
||||
LoadS1(Shape1);
|
||||
LoadS2(Shape2);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include <BRepExtrema_SeqOfSolution.hxx>
|
||||
#include <BRepExtrema_SolutionElem.hxx>
|
||||
#include <BRepExtrema_SupportType.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
@@ -38,9 +39,9 @@ class BRepExtrema_DistShapeShape
|
||||
Standard_EXPORT BRepExtrema_DistShapeShape();
|
||||
//! computation of the minimum distance (value and pair of points) using default deflection <br>
|
||||
//! Default value is Precision::Confusion(). <br>
|
||||
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
|
||||
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
//! create tool and load both shapes into it <br>
|
||||
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
|
||||
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
|
||||
|
||||
void SetDeflection(const Standard_Real theDeflection)
|
||||
{
|
||||
@@ -128,6 +129,11 @@ class BRepExtrema_DistShapeShape
|
||||
myFlag = F;
|
||||
}
|
||||
|
||||
void SetAlgo(const Extrema_ExtAlgo A)
|
||||
{
|
||||
myAlgo = A;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! computes the minimum distance between two maps of shapes (Face,Edge,Vertex) <br>
|
||||
@@ -150,6 +156,7 @@ private:
|
||||
Standard_Boolean myIsInitS1;
|
||||
Standard_Boolean myIsInitS2;
|
||||
Extrema_ExtFlag myFlag;
|
||||
Extrema_ExtAlgo myAlgo;
|
||||
Bnd_SeqOfBox myBV1;
|
||||
Bnd_SeqOfBox myBV2;
|
||||
Bnd_SeqOfBox myBE1;
|
||||
|
@@ -772,7 +772,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& S1, const TopoDS_Face&
|
||||
const Standard_Real Dst=B1.Distance(B2);
|
||||
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
|
||||
{
|
||||
BRepExtrema_ExtPF Ext(S1,S2,myFlag);
|
||||
BRepExtrema_ExtPF Ext(S1,S2,myFlag,myAlgo);
|
||||
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
|
||||
if ( NbExtrema > 0 )
|
||||
{
|
||||
@@ -828,7 +828,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Face& S1, const TopoDS_Vertex&
|
||||
const Standard_Real Dst=B1.Distance(B2);
|
||||
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
|
||||
{
|
||||
BRepExtrema_ExtPF Ext(S2,S1,myFlag);
|
||||
BRepExtrema_ExtPF Ext(S2,S1,myFlag,myAlgo);
|
||||
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
|
||||
if ( NbExtrema > 0 )
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <BRepExtrema_SeqOfSolution.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
@@ -38,8 +39,9 @@ class BRepExtrema_DistanceSS
|
||||
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
|
||||
const Bnd_Box& B1, const Bnd_Box& B2,
|
||||
const Standard_Real DstRef,
|
||||
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
|
||||
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F)
|
||||
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
|
||||
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
|
||||
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
|
||||
{
|
||||
Perform(S1, S2, B1, B2);
|
||||
}
|
||||
@@ -50,8 +52,9 @@ class BRepExtrema_DistanceSS
|
||||
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
|
||||
const Bnd_Box& B1, const Bnd_Box& B2,
|
||||
const Standard_Real DstRef, const Standard_Real aDeflection,
|
||||
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
|
||||
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F)
|
||||
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
|
||||
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
|
||||
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
|
||||
{
|
||||
Perform(S1, S2, B1, B2);
|
||||
}
|
||||
@@ -80,6 +83,11 @@ class BRepExtrema_DistanceSS
|
||||
{
|
||||
myFlag = F;
|
||||
}
|
||||
//! sets the flag controlling ...
|
||||
void SetAlgo(const Extrema_ExtAlgo A)
|
||||
{
|
||||
myAlgo = A;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -122,6 +130,7 @@ class BRepExtrema_DistanceSS
|
||||
Standard_Boolean myModif;
|
||||
Standard_Real myEps;
|
||||
Extrema_ExtFlag myFlag;
|
||||
Extrema_ExtAlgo myAlgo;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -32,9 +32,9 @@
|
||||
//=======================================================================
|
||||
|
||||
BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoDS_Face& TheFace,
|
||||
const Extrema_ExtFlag TheFlag)
|
||||
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
|
||||
{
|
||||
Initialize(TheFace,TheFlag);
|
||||
Initialize(TheFace,TheFlag,TheAlgo);
|
||||
Perform(TheVertex,TheFace);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoD
|
||||
//=======================================================================
|
||||
|
||||
void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
|
||||
const Extrema_ExtFlag TheFlag)
|
||||
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
|
||||
{
|
||||
// cette surface doit etre en champ. Extrema ne fait
|
||||
// pas de copie et prend seulement un pointeur dessus.
|
||||
@@ -60,6 +60,7 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
|
||||
Standard_Real U1, U2, V1, V2;
|
||||
BRepTools::UVBounds(TheFace, U1, U2, V1, V2);
|
||||
myExtPS.SetFlag(TheFlag);
|
||||
myExtPS.SetAlgo(TheAlgo);
|
||||
myExtPS.Initialize(mySurf, U1, U2, V1, V2, aTolU, aTolV);
|
||||
}
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <Extrema_SequenceOfPOnSurf.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Extrema_ExtFlag.hxx>
|
||||
#include <Extrema_ExtAlgo.hxx>
|
||||
|
||||
class TopoDS_Vertex;
|
||||
class TopoDS_Face;
|
||||
@@ -37,10 +38,12 @@ class BRepExtrema_ExtPF
|
||||
{}
|
||||
//! It calculates all the distances. <br>
|
||||
Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace,
|
||||
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
|
||||
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
|
||||
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
|
||||
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
|
||||
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
|
||||
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
|
||||
|
||||
//! An exception is raised if the fields have not been initialized. <br>
|
||||
//! Be careful: this method uses the Face only for classify not for the fields. <br>
|
||||
@@ -76,6 +79,11 @@ class BRepExtrema_ExtPF
|
||||
myExtPS.SetFlag(F);
|
||||
}
|
||||
|
||||
void SetAlgo(const Extrema_ExtAlgo A)
|
||||
{
|
||||
myExtPS.SetAlgo(A);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Extrema_ExtPS myExtPS;
|
||||
|
@@ -2923,38 +2923,46 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
|
||||
Standard_Real Extend = 0.0;
|
||||
if (NbTrous==1) Extend = EvalExtrapol(1, Transition);
|
||||
isDone = BuildShell(Transition,
|
||||
1, NbPath+1,
|
||||
1, NbPath+1,
|
||||
ReversedEdges,
|
||||
Tapes, Rails,
|
||||
Extend, Extend);
|
||||
Extend, Extend);
|
||||
}
|
||||
else { // This is done piece by piece
|
||||
Standard_Integer IFirst = 1, ILast;
|
||||
for (ii=1, isDone=Standard_True;
|
||||
ii<=NbPart && isDone; ii++) {
|
||||
if (ii > NbTrous) ILast = NbPath+1;
|
||||
else ILast = Trous->Value(ii);
|
||||
isDone = BuildShell(Transition,
|
||||
IFirst, ILast,
|
||||
ii<=NbPart && isDone; ii++) {
|
||||
if (ii > NbTrous) ILast = NbPath+1;
|
||||
else ILast = Trous->Value(ii);
|
||||
isDone = BuildShell(Transition,
|
||||
IFirst, ILast,
|
||||
ReversedEdges,
|
||||
Tapes, Rails,
|
||||
EvalExtrapol(IFirst, Transition),
|
||||
EvalExtrapol(ILast, Transition));
|
||||
if (IFirst>1) {
|
||||
Translate(myVEdges, IFirst, Bounds, 2);
|
||||
PerformCorner(IFirst,
|
||||
Transition, Bounds);
|
||||
}
|
||||
IFirst = ILast;
|
||||
Translate(myVEdges, IFirst, Bounds, 1);
|
||||
EvalExtrapol(IFirst, Transition),
|
||||
EvalExtrapol(ILast, Transition));
|
||||
if (IFirst>1) {
|
||||
Translate(myVEdges, IFirst, Bounds, 2);
|
||||
if (!PerformCorner(IFirst,
|
||||
Transition, Bounds))
|
||||
{
|
||||
isDone = Standard_False;
|
||||
return;
|
||||
}
|
||||
}
|
||||
IFirst = ILast;
|
||||
Translate(myVEdges, IFirst, Bounds, 1);
|
||||
}
|
||||
}
|
||||
// Management of looping ends
|
||||
if ( (NbTrous>0) && (myLoc->IsClosed()) &&
|
||||
(Trous->Value(NbTrous) == NbPath+1) ) {
|
||||
(Trous->Value(NbTrous) == NbPath+1) ) {
|
||||
Translate(myVEdges, NbPath+1, Bounds, 1);
|
||||
Translate(myVEdges, 1, Bounds, 2);
|
||||
PerformCorner(1, Transition, Bounds);
|
||||
if (!PerformCorner(1, Transition, Bounds))
|
||||
{
|
||||
isDone = Standard_False;
|
||||
return;
|
||||
}
|
||||
Translate(myVEdges, 1, myVEdges, NbPath+1);
|
||||
}
|
||||
|
||||
@@ -3175,12 +3183,14 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
//function : PerformCorner
|
||||
//purpose : Trim and/or loop a corner
|
||||
//======================================================================
|
||||
void BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
|
||||
const BRepFill_TransitionStyle Transition,
|
||||
const Handle(TopTools_HArray2OfShape)& Bounds)
|
||||
Standard_Boolean BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
|
||||
const BRepFill_TransitionStyle Transition,
|
||||
const Handle(TopTools_HArray2OfShape)& Bounds)
|
||||
{
|
||||
|
||||
if (Transition == BRepFill_Modified) return; // Do nothing.
|
||||
if (Transition == BRepFill_Modified) return Standard_True; // Do nothing.
|
||||
|
||||
const Standard_Real anAngularTol = 0.025;
|
||||
|
||||
BRepFill_TransitionStyle TheTransition = Transition;
|
||||
Standard_Boolean isTangent=Standard_False;
|
||||
@@ -3226,11 +3236,15 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "BRepFill_Sweep::PerformCorner : This is not a corner !" << std::endl;
|
||||
#endif
|
||||
return;
|
||||
return Standard_True;
|
||||
}
|
||||
Sortant = t2 - t1;
|
||||
}
|
||||
|
||||
if (T1.Angle(T2) >= M_PI - anAngularTol)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
if ((TheTransition == BRepFill_Right)
|
||||
&& (T1.Angle(T2) > myAngMax) ) {
|
||||
TheTransition = BRepFill_Round;
|
||||
@@ -3336,7 +3350,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Fail of TrimCorner" << std::endl;
|
||||
#endif
|
||||
return; // Nothing is touched
|
||||
return Standard_True; // Nothing is touched
|
||||
}
|
||||
|
||||
if (mySec->IsUClosed())
|
||||
@@ -3416,7 +3430,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
/*
|
||||
#if DRAW
|
||||
if (Affich) {
|
||||
|
@@ -124,7 +124,7 @@ protected:
|
||||
|
||||
Standard_EXPORT Standard_Boolean BuildShell (const BRepFill_TransitionStyle Transition, const Standard_Integer Vf, const Standard_Integer Vl, TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const Standard_Real ExtendFirst = 0.0, const Standard_Real ExtendLast = 0.0);
|
||||
|
||||
Standard_EXPORT void PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
|
||||
Standard_EXPORT Standard_Boolean PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
|
||||
|
||||
Standard_EXPORT Standard_Real EvalExtrapol (const Standard_Integer Index, const BRepFill_TransitionStyle Transition) const;
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include <BRepLib_MakeFace.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <GCPnts.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
@@ -182,6 +181,39 @@ BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S,
|
||||
|
||||
namespace
|
||||
{
|
||||
static void fillParams (const TColStd_Array1OfReal& theKnots,
|
||||
Standard_Integer theDegree,
|
||||
Standard_Real theParMin,
|
||||
Standard_Real theParMax,
|
||||
NCollection_Vector<Standard_Real>& theParams)
|
||||
{
|
||||
Standard_Real aPrevPar = theParMin;
|
||||
theParams.Append (aPrevPar);
|
||||
|
||||
Standard_Integer aNbP = Max (theDegree, 1);
|
||||
|
||||
for (Standard_Integer i = 1;
|
||||
(i < theKnots.Length()) && (theKnots (i) < (theParMax - Precision::PConfusion())); ++i)
|
||||
{
|
||||
if (theKnots (i + 1) < theParMin + Precision::PConfusion())
|
||||
continue;
|
||||
|
||||
Standard_Real aStep = (theKnots (i + 1) - theKnots (i)) / aNbP;
|
||||
for (Standard_Integer k = 1; k <= aNbP ; ++k)
|
||||
{
|
||||
Standard_Real aPar = theKnots (i) + k * aStep;
|
||||
if (aPar > theParMax - Precision::PConfusion())
|
||||
break;
|
||||
|
||||
if (aPar > aPrevPar + Precision::PConfusion())
|
||||
{
|
||||
theParams.Append (aPar);
|
||||
aPrevPar = aPar;
|
||||
}
|
||||
}
|
||||
}
|
||||
theParams.Append (theParMax);
|
||||
}
|
||||
|
||||
static void fillPoints (const BRepAdaptor_Curve& theCurve,
|
||||
const NCollection_Vector<Standard_Real> theParams,
|
||||
@@ -329,13 +361,13 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
|
||||
aKnots.SetValue (1, GC->FirstParameter());
|
||||
aKnots.SetValue (2, GC->LastParameter());
|
||||
|
||||
GCPnts::FillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
|
||||
fillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineCurve:
|
||||
{
|
||||
Handle(Geom_BSplineCurve) GC = c.BSpline();
|
||||
GCPnts::FillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
|
||||
fillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Line:
|
||||
@@ -362,7 +394,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
|
||||
aBounds.SetValue (1, dfUf);
|
||||
aBounds.SetValue (2, dfUl);
|
||||
|
||||
GCPnts::FillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
|
||||
fillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user