1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

..

1 Commits

291 changed files with 6162 additions and 4338 deletions

View File

@@ -930,9 +930,6 @@ if (WIN32)
OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
# install env script
install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
# copy build.bat and install.bat scripts to CMake binary folder
OCCT_COPY_FILE_OR_DIR ("adm/templates/build.bat" "${CMAKE_BINARY_DIR}")
OCCT_COPY_FILE_OR_DIR ("adm/templates/install.bat" "${CMAKE_BINARY_DIR}")
else()
set (SUB_ENV_NAME "env.${SCRIPT_EXT}")
set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}")

View File

@@ -2,28 +2,19 @@
# execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
# delete obsolete 3RDPARTY_BISON_EXECUTABLE cache variable (not used anymore)
unset (3RDPARTY_BISON_EXECUTABLE CACHE)
# delete BISON_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
# without reasonable diagnostic
if (NOT BISON_EXECUTABLE)
unset (BISON_EXECUTABLE CACHE)
if (NOT DEFINED 3RDPARTY_BISON_EXECUTABLE)
set (3RDPARTY_BISON_EXECUTABLE "" CACHE FILEPATH "The path to the bison command")
endif()
# Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make
# these paths searhed by find_package
if (3RDPARTY_DIR)
file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/")
foreach (candidate_path ${BISON_PATHS})
if (IS_DIRECTORY ${candidate_path})
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
endif()
endforeach()
endif()
find_package (BISON 2.7)
# BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
if (NOT BISON_FOUND OR NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
list (APPEND 3RDPARTY_NOT_INCLUDED BISON_EXECUTABLE)
find_package (BISON)
if (BISON_FOUND)
set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
endif()
if (NOT 3RDPARTY_BISON_EXECUTABLE OR NOT EXISTS "${3RDPARTY_BISON_EXECUTABLE}")
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_BISON_EXECUTABLE)
endif()

View File

@@ -2,28 +2,19 @@
# execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro
# delete obsolete 3RDPARTY_FLEX_EXECUTABLE cache variable (not used anymore)
unset (3RDPARTY_FLEX_EXECUTABLE CACHE)
# delete FLEX_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
# without reasonable diagnostic
if (NOT FLEX_EXECUTABLE)
unset (FLEX_EXECUTABLE CACHE)
if (NOT DEFINED 3RDPARTY_FLEX_EXECUTABLE)
set (3RDPARTY_FLEX_EXECUTABLE "" CACHE FILEPATH "The Path to the flex command")
endif()
# Add paths to 3rdparty subfolders containing name "flex" to CMAKE_PROGRAM_PATH variable to make
# these paths searhed by find_package
if (3RDPARTY_DIR)
file (GLOB FLEX_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*flex*")
foreach (candidate_path ${FLEX_PATHS})
if (IS_DIRECTORY ${candidate_path})
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
endif()
endforeach()
endif()
find_package (FLEX 2.5.3)
# FLEX_EXECUTABLE is required by FLEX_TARGET macro and should be defined
set (FLEX_EXECUTABLE "${3RDPARTY_FLEX_EXECUTABLE}" CACHE FILEPATH "path to the flex executable" FORCE)
if (NOT FLEX_FOUND OR NOT FLEX_EXECUTABLE OR NOT EXISTS "${FLEX_EXECUTABLE}")
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_EXECUTABLE)
find_package (FLEX)
if (FLEX_FOUND)
set (3RDPARTY_FLEX_EXECUTABLE "${FLEX_EXECUTABLE}" CACHE FILEPATH "The Path to the flex command" FORCE)
endif()
if (NOT 3RDPARTY_FLEX_EXECUTABLE OR NOT EXISTS "${3RDPARTY_FLEX_EXECUTABLE}")
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FLEX_EXECUTABLE)
endif()

View File

@@ -93,8 +93,8 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})

View File

@@ -1,2 +0,0 @@
*custom.bat
*custom.sh

View File

@@ -1,234 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for Android platform.
rem android_custom.bat should be configured with paths
rem to CMake, 3rd-parties, Android NDK and MinGW make tool.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "anNdkPath="
set "aFreeType="
set "aRapidJson="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=1"
set "isStatic=0"
rem Minimal Android platform and CPU architectures
set "anNdkApiLevel=21"
set "anNdkAbiList=armeabi-v7a x86 arm64-v8a x86_64"
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
set USE_RAPIDJSON=OFF
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0android_custom.bat" call "%~dp0android_custom.bat"
set "aCompiler=gcc"
set "aCppLib=gnustl_shared"
if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
if exist "%anNdkPath%/sources/cxx-stl/llvm-libc++" (
set "aCompiler=clang"
set "aCppLib=c++_shared"
)
)
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
set "aDestDir=%aBuildRoot%\android-%aCompiler%"
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
call :cmakeGenerate "%anNdkApiLevel%" "%%s"
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-android"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "anApi=%~1"
set "anAbi=%~2"
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
set "aWorkDir=%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for Android %anAbi%, API level %anApi%...
cmake -G "MinGW Makefiles" ^
-D CMAKE_SYSTEM_NAME:STRING="Android" ^
-D CMAKE_ANDROID_NDK="%anNdkPath%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D CMAKE_ANDROID_ARCH_ABI:STRING="%anAbi%" ^
-D CMAKE_SYSTEM_VERSION:STRING="%anApi%" ^
-D CMAKE_ANDROID_STL_TYPE="%aCppLib%" ^
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_LIB:STRING="libs/%anAbi%" ^
-D INSTALL_DIR_CMAKE:STRING="libs/%anAbi%/cmake/opencascade" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/libs/%anAbi%" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/libfreetype.so" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set aTimeGEN=%TIME%
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set aTimeBUILD=%TIME%
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,31 +0,0 @@
rem Environment configuration template for android_build.bat (to be renamed as android_custom.bat)
rem Paths to 3rd-party tools and libraries
rem call c:\TDM-GCC-64\mingwvars.bat
rem set "PATH=c:\CMake\bin;%PATH%"
rem set "anNdkPath=c:/android-ndk-r12"
rem set "aFreeType=c:/freetype-2.7.1-android"
rem set "aRapidJson=c:/rapidjson-1.1.0"
rem Uncomment to customize building steps
rem set "aBuildRoot=%~dp0..\..\work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "isStatic=0"
rem Minimal Android platform and CPU architectures
rem set "anNdkApiLevel=21"
rem set "anNdkAbiList=arm64-v8a x86_64"
rem OCCT Modules to build
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
rem set USE_RAPIDJSON=ON

View File

@@ -1,46 +0,0 @@
rem Environment configuration template for cmake_gen.bat (to be renamed as cmake_gen_custom.bat)
set "OCCT3RDPARTY=%SrcRoot%\..\3rdparty"
set VS=14
set VSDATA=2015
rem Leave VSPLATFORM empty to build for x86 platform
set VSPLATFORM=Win64
rem ------------------------------------
rem Uncomment to customize building steps
rem ------------------------------------
rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
rem set "INSTALL_DIR=%SrcRoot%\install"
rem set BUILD_DOC_Overview=OFF
rem set BUILD_Inspector=OFF
rem set BUILD_LIBRARY_TYPE=Shared
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
rem set BUILD_ADDITIONAL_TOOLKITS=
rem Set a directory recognized as a patch for OCCT.
rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON
rem set BUILD_MODULE_Visualization=ON
rem set USE_D3D=OFF
rem set USE_FFMPEG=OFF
rem set USE_FREEIMAGE=OFF
rem set USE_GLES2=OFF
rem set USE_RAPIDJSON=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -1,42 +0,0 @@
# Environment configuration template for cmake_gen.sh (to be renamed as cmake_gen_custom.sh)
OCCT3RDPARTY="$SrcRoot/../3rdparty"
FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# ------------------------------------
# Uncomment to customize building steps
# ------------------------------------
#BUILD_DIR=build
#INSTALL_DIR="$SrcRoot/install"
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
#BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
# Use semicolon-separated list of toolkits if you want to disable all modules
# and build only some toolkits.
#BUILD_ADDITIONAL_TOOLKITS=
# Set a directory recognized as a patch for OCCT.
#BUILD_PATCH=
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON
#BUILD_MODULE_Visualization=ON
#USE_FFMPEG=OFF
#USE_FREEIMAGE=OFF
#USE_GLES2=OFF
#USE_RAPIDJSON=OFF
#USE_TBB=OFF
#USE_VTK=OFF
# This is to add any additional arguments to cmake
#AUX_ARGS=

View File

@@ -1,83 +0,0 @@
@echo off
rem Auxiliary script for semi-automated building of OCCT using cmake.
rem cmake_custom.bat should be configured with VS version and path to 3rd-parties.
rem OCCT3RDPARTY must be specified as mandatory dependency.
setlocal
set "SrcRoot=%~dp0..\.."
set VS=14
set VSDATA=2015
set VSPLATFORM=Win64
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
set BUILD_LIBRARY_TYPE=Shared
set BUILD_PATCH=
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
set BUILD_USE_PCH=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
set BUILD_MODULE_Draw=ON
set BUILD_MODULE_ModelingAlgorithms=ON
set BUILD_MODULE_ModelingData=ON
set BUILD_MODULE_Visualization=ON
set USE_D3D=OFF
set USE_FFMPEG=OFF
set USE_FREEIMAGE=OFF
set USE_GLES2=OFF
set USE_RAPIDJSON=OFF
set USE_TBB=OFF
set USE_VTK=OFF
if exist "%~dp0cmake_custom.bat" call "%~dp0cmake_custom.bat"
if not "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA% %VSPLATFORM%"
if "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA%"
set "INSTALL_DIR=%INSTALL_DIR:\=/%"
set "OCCT3RDPARTY=%OCCT3RDPARTY:\=/%"
set "BUILD_DIR=%SrcRoot%\%BUILD_DIR%"
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
pushd "%BUILD_DIR%"
cmake -G "%arch_compile%" ^
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
-D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
-D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
-D USE_D3D:BOOL=%USE_D3D% ^
-D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
-D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
-D USE_GLES2:BOOL=%USE_GLES2% ^
-D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
-D USE_TBB:BOOL=%USE_TBB% ^
-D USE_VTK:BOOL=%USE_VTK% ^
"%SrcRoot%"
popd
endlocal

View File

@@ -1,86 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT using cmake.
# cmake_custom.sh should be configured with path to 3rd-parties.
# OCCT3RDPARTY and FREETYPE_DIR must be specified as mandatory dependencies.
ScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SrcRoot="${ScriptDir}/../.."
INSTALL_DIR="$SrcRoot/install"
BUILD_DIR=build
DEB=
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
DEB=d
BUILD_DIR=${BUILD_DIR}-deb
CMAKE_BUILD_TYPE=Debug
fi
INSTALL_DIR_BIN=lin64/gcc/bin$DEB
INSTALL_DIR_LIB=lin64/gcc/lib$DEB
BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
BUILD_LIBRARY_TYPE=Shared
BUILD_PATCH=
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
BUILD_WITH_DEBUG=OFF
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
BUILD_MODULE_ApplicationFramework=ON
BUILD_MODULE_DataExchange=ON
BUILD_MODULE_Draw=ON
BUILD_MODULE_ModelingAlgorithms=ON
BUILD_MODULE_ModelingData=ON
BUILD_MODULE_Visualization=ON
USE_FFMPEG=OFF
USE_FREEIMAGE=OFF
USE_GLES2=OFF
USE_RAPIDJSON=OFF
USE_TBB=OFF
USE_VTK=OFF
AUX_ARGS=
if [ -f "${ScriptDir}/cmake_custom.sh" ]; then
. "${ScriptDir}/cmake_custom.sh"
fi
BUILD_DIR="$SrcRoot/$BUILD_DIR"
if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
pushd "$BUILD_DIR"
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \
-D INSTALL_DIR:PATH="$INSTALL_DIR" \
-D INSTALL_DIR_LAYOUT:STRING=Windows \
-D INSTALL_DIR_BIN:STRING=$INSTALL_DIR_BIN \
-D INSTALL_DIR_LIB:STRING=$INSTALL_DIR_LIB \
-D USE_FFMPEG:BOOL=$USE_FFMPEG \
-D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \
-D USE_GLES2:BOOL=$USE_GLES2 \
-D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \
-D USE_TBB:BOOL=$USE_TBB \
-D USE_VTK:BOOL=$USE_VTK \
$AUX_ARGS "$SrcRoot"
popd

View File

@@ -1,165 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for WASM platform.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aSrcRoot=%~dp0..\.."
set "aBuildRoot=work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
call :cmakeGenerate
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm"
set "aWorkDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aDestDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%"
set "aLogFile=%aSrcRoot%\%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set aTimeZERO=%TIME%
if ["%toCMake%"] == ["1"] (
echo "Configuring OCCT for WASM..."
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
"%aSrcRoot%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set aTimeGEN=%TIME%
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if "%toClean%"=="1" (
mingw32-make clean
)
if "%toMake%"=="1" (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set aTimeBUILD=%TIME%
call :computeDuration %aTimeGEN% %aTimeBUILD%
if "%toMake%"=="1" (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if "%toMake%"=="1" (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if "%toInstall%"=="1" (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set aTimeINSTALL=%TIME%
call :computeDuration %aTimeBUILD% %aTimeINSTALL%
if "%toInstall%"=="1" (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeINSTALL%
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set aTimeFrom=%1
set aTimeEnd=%2
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,126 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for WASM platform.
# wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
# FreeType should be specified as mandatory dependency.
export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export aSrcRoot="${aScriptDir}/../.."
export aBuildRoot=work
export aNbJobs=${NUMBER_OF_PROCESSORS}
export toCMake=1
export toClean=0
export toMake=1
export toInstall=1
export BUILD_ModelingData=ON
export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
fi
. "${EMSDK_ROOT}/emsdk_env.sh"
export aToolchain="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
export aGitBranch=`git symbolic-ref --short HEAD`
echo "Compilation OCCT branch : $aGitBranch"
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
if [ ! -d "${aWorkDir}" ]; then
mkdir -p "${aWorkDir}"
fi
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
if [ ! -d "${aDestDir}" ]; then
mkdir -p "${aDestDir}"
fi
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aLogFile}" ]; then
rm "${aLogFile}"
fi
echo Start building OCCT for ${aPlatformAndCompiler}
echo Start building OCCT for ${aPlatformAndCompiler}>> "${aLogFile}"
pushd "${aWorkDir}"
pwd
echo toCMake=${toCMake}
if [ "${toCMake}" = "1" ]; then
echo "Configuring OCCT for WASM..."
echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
if [ $? -ne 0 ]; then
echo "Problem during configuration"
popd
exit 1
fi
fi
if [ "${toClean}" = "1" ]; then
make clean
fi
if [ "${toMake}" = "1" ]; then
echo Building...
make -j ${aNbJobs} 2>> "${aLogFile}"
if [ $? -ne 0 ]; then
echo "Problem during make operation"
popd
exit 1
fi
echo "${aLogFile}"
fi
if [ "${toInstall}" = "1" ]; then
echo Installing into ${aDestDir}
make install 2>> "${aLogFile}"
fi
popd

View File

@@ -1,16 +0,0 @@
rem Environment configuration template for occ_build_wasm.bat (to be renamed as wasm_custom_env.bat)
set "aFreeType=%aSrcRoot%\..\3rdparty\freetype-2.7.1-wasm"
set "EMSDK_ROOT=%aSrcRoot%\..\emsdk"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"

View File

@@ -1,16 +0,0 @@
# environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
export EMSDK_ROOT="$aSrcRoot/../emsdk"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=0
#export toMake=1
#export toInstall=1
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON

View File

@@ -21,7 +21,6 @@ set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
# This is made to support different locations of CMake files:
# - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version>
# - in Windows style: $INSTALL_DIR/cmake
# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade-<version>
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
@@ -30,10 +29,6 @@ endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()
# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")

View File

@@ -1,38 +0,0 @@
@echo off
setlocal
rem Setup environment
call "%~dp0env.bat" %1 %2 %3
rem Define path to project file
set "PRJFILE=%~dp0OCCT.sln"
if "%VCVER%" == "vc8" (
call "%VS80COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc9" (
call "%VS90COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc10" (
call "%VS100COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc11" (
call "%VS110COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc12" (
call "%VS120COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc14" (
call "%VS140COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc141" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B
)
set BUILDCONFIG=Release
if "%CASDEB%"=="i" set BUILDCONFIG=RelWithDebInfo
if "%CASDEB%"=="d" set BUILDCONFIG=Debug
if "%ARCH%"=="32" set PLATFORM=win32
if "%ARCH%"=="64" set PLATFORM=x64
msbuild "%PRJFILE%" /m /fl /flp:LogFile="build_%BUILDCONFIG%.log" /p:Configuration=%BUILDCONFIG% /p:Platform=%PLATFORM% /p:BuildProjectReferences=false
endlocal

View File

@@ -1,38 +0,0 @@
@echo off
setlocal
rem Setup environment
call "%~dp0env.bat" %1 %2 %3
rem Define path to project file
set "PRJFILE=%~dp0INSTALL.vcxproj"
if "%VCVER%" == "vc8" (
call "%VS80COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc9" (
call "%VS90COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc10" (
call "%VS100COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc11" (
call "%VS110COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc12" (
call "%VS120COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc14" (
call "%VS140COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc141" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B
)
set BUILDCONFIG=Release
if "%CASDEB%"=="i" set BUILDCONFIG=RelWithDebInfo
if "%CASDEB%"=="d" set BUILDCONFIG=Debug
if "%ARCH%"=="32" set PLATFORM=win32
if "%ARCH%"=="64" set PLATFORM=x64
msbuild "%PRJFILE%" /m /fl /flp:LogFile="install_%BUILDCONFIG%.log" /p:Configuration=%BUILDCONFIG% /p:Platform=%PLATFORM% /p:BuildProjectReferences=false
endlocal

View File

@@ -1980,10 +1980,6 @@ Previously, sub-classes of *Message_Printer* have to provide a triplet of *Messa
*Message_Printer* interface has been changed, so that sub-classes now have to implement only single method *Message_Printer::send()* accepting TCollection_AsciiString argument and having no Endl flag, which has been removed.
Old three Message_Printer::Send() methods remain defined virtual with unused last argument and redirecting to new send() method by default.
@subsection upgrade_750_prd3d_root Prs3d_Root deprecation
Redundant class Prs3d_Root has been marked as deprecated - Prs3d_Presentation::NewGroup() should be called directly.
@subsection upgrade_750_draw_hotkeys Draw Harness hotkeys
Draw Harness hotkeys **W** (Wireframe) and **S** (Shaded) have been re-mapped to **Ctrl+W** and **Ctrl+S**.

View File

@@ -30,7 +30,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer )
{
Handle(Graphic3d_Group) aPrsGroup = thePrs->CurrentGroup();
Handle(Graphic3d_Group) aPrsGroup = Prs3d_Root::CurrentGroup (thePrs);
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());

View File

@@ -84,10 +84,10 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
aPrims->AddVertex (myPnt);
aPrims->AddVertex (aLastPoint);
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
// Draw arrow
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
aLastPoint,
myDir,
anArrowAspect->Angle(),
@@ -97,7 +97,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
if (myText.Length() != 0)
{
gp_Pnt aTextPosition = aLastPoint;
Prs3d_Text::Draw (aPresentation->CurrentGroup(),
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),
myDrawer->TextAspect(),
myText,
aTextPosition);

View File

@@ -214,6 +214,7 @@
#include <Precision.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_IsoAspect.hxx>

View File

@@ -42,10 +42,10 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*a
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
aPrims->AddVertex (myStartPnt);
aPrims->AddVertex (myEndPnt);
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
// Draw arrow
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
myEndPnt,
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
anArrowAspect->Angle(),

View File

@@ -126,6 +126,7 @@
#include <Plate_GtoCConstraint.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Root.hxx>
#include <GeomPlate_Surface.hxx>
#include <GeomProjLib.hxx>
#include <GCE2d_MakeSegment.hxx>

View File

@@ -46,7 +46,7 @@ void Sample2D_Face::DrawMarker(const Handle(Geom2d_TrimmedCurve)& theCurve, cons
anArrow->AddVertex(aPoint);
anArrow->AddVertex(aRight);
thePresentation->CurrentGroup()->AddPrimitiveArray(anArrow);
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(anArrow);
}
}
@@ -212,19 +212,19 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
{
case TopAbs_FORWARD: {
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
DrawMarker(aTrimmedCurve, thePresentation);
break;
}
case TopAbs_REVERSED: {
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
DrawMarker(aTrimmedCurve, thePresentation);
break;
}
case TopAbs_INTERNAL: {
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
DrawMarker(aTrimmedCurve, thePresentation);
mySeq_INTERNAL.Append(aCurve3d);
@@ -232,7 +232,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
}
case TopAbs_EXTERNAL: {
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
DrawMarker(aTrimmedCurve, thePresentation);
break;
}
@@ -242,17 +242,17 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
ex.Next();
}
//add all primitives to the presentation
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
thePresentation->CurrentGroup()->AddPrimitiveArray(myForwardArray);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myForwardArray);
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
thePresentation->CurrentGroup()->AddPrimitiveArray(myReversedArray);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myReversedArray);
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
thePresentation->CurrentGroup()->AddPrimitiveArray(myInternalArray);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myInternalArray);
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
thePresentation->CurrentGroup()->AddPrimitiveArray(myExternalArray);
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myExternalArray);
}
//Method for advanced customizable selection of picked object
@@ -275,7 +275,8 @@ void Sample2D_Face::HilightSelected
aSelectionPrs->Clear();
FillData();
Handle (Graphic3d_Group) aSelectGroup = aSelectionPrs->NewGroup();
Prs3d_Root::NewGroup ( aSelectionPrs );
Handle (Graphic3d_Group) aSelectGroup = Prs3d_Root::CurrentGroup ( aSelectionPrs);
for(Standard_Integer i=1; i<=aLength; ++i)
{
@@ -343,7 +344,8 @@ void Sample2D_Face::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationMana
FillData();
//Direct highlighting
Handle (Graphic3d_Group) aHilightGroup = aHighlightPrs->NewGroup();
Prs3d_Root::NewGroup ( aHighlightPrs );
Handle (Graphic3d_Group) aHilightGroup = Prs3d_Root::CurrentGroup(aHighlightPrs);
Handle(Graphic3d_AspectLine3d) aLineAspect =
new Graphic3d_AspectLine3d(theStyle->Color(), Aspect_TOL_SOLID,2);
switch(theOwner->Priority())

View File

@@ -43,15 +43,15 @@ void Sample2D_Markers::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aP
if(myMarkerType == Aspect_TOM_USERDEFINED)
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
aPresentation->CurrentGroup()->SetGroupPrimitivesAspect(aMarker);
aPresentation->CurrentGroup()->AddPrimitiveArray (myArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
}
else
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
aPresentation->CurrentGroup()->SetPrimitivesAspect(aMarker);
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
}

View File

@@ -66,6 +66,7 @@
#include <gp_Pnt2d.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>

View File

@@ -76,7 +76,7 @@ case 6: //color
Handle(Graphic3d_StructureManager) aStrucMana = GetContext()->MainPrsMgr()->StructureManager();
Handle(Graphic3d_Group) mygroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) mygroup = Prs3d_Root::CurrentGroup(aPresentation);
myAspect = (new Prs3d_ShadingAspect())->Aspect();
Graphic3d_MaterialAspect material = myAspect->FrontMaterial();
material.SetAmbientColor (Quantity_NOC_BLACK);
@@ -281,7 +281,7 @@ case 6: //color
} // end of "if the triangle is valid
} // end of the "parcours" of the triangles
aPresentation->CurrentGroup()->AddPrimitiveArray (aOP);
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aOP);
mygroup->SetGroupPrimitivesAspect(myAspect);
}// end of the exploration of the shape in faces

View File

@@ -28,6 +28,7 @@
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Text.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>

View File

@@ -33,6 +33,7 @@
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Root.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_ErrorHandler.hxx>
#include <StdSelect_BRepSelectionTool.hxx>

View File

@@ -21,6 +21,7 @@
#include <gce_MakeDir.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_ToolDisk.hxx>
#include <Prs3d_ToolSector.hxx>
@@ -1212,8 +1213,7 @@ void AIS_Manipulator::Disk::Init (const Standard_ShortReal theInnerRadius,
gp_Ax3 aSystem (myPosition.Location(), myPosition.Direction());
gp_Trsf aTrsf;
aTrsf.SetTransformation (aSystem, gp_Ax3());
myArray = aTool.CreateTriangulation (aTrsf);
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
aTool.FillArray (myArray, myTriangulation, aTrsf);
}
//=======================================================================
@@ -1232,8 +1232,7 @@ void AIS_Manipulator::Sphere::Init (const Standard_ShortReal theRadius,
Prs3d_ToolSphere aTool (theRadius, theSlicesNb, theStacksNb);
gp_Trsf aTrsf;
aTrsf.SetTranslation (gp_Vec(gp::Origin(), thePosition));
myArray = aTool.CreateTriangulation (aTrsf);
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
aTool.FillArray (myArray, myTriangulation, aTrsf);
}
//=======================================================================
@@ -1269,24 +1268,24 @@ void AIS_Manipulator::Cube::Init (const gp_Ax1& thePosition, const Standard_Shor
addTriangle (1, aBottomLeft, aV3, aV4, -thePosition.Direction());
// Front
addTriangle (2, aV3, aV5, aV4, -aFront);
addTriangle (3, aV3, aTopRight, aV5, -aFront);
addTriangle (2, aV3, aV4, aV5, aFront);
addTriangle (3, aV3, aV5, aTopRight, aFront);
// Back
addTriangle (4, aBottomLeft, aV7, aV2, aFront);
addTriangle (5, aBottomLeft, aV6, aV7, aFront);
addTriangle (4, aBottomLeft, aV2, aV7, -aFront);
addTriangle (5, aBottomLeft, aV7, aV6, -aFront);
// aTop
addTriangle (6, aV7, aV6, aV5, thePosition.Direction());
addTriangle (7, aTopRight, aV7, aV5, thePosition.Direction());
// Left
addTriangle (8, aV6, aV4, aV5, aRight);
addTriangle (9, aBottomLeft, aV4, aV6, aRight);
//Left
addTriangle (8, aV6, aV5, aV4, -aRight);
addTriangle (9, aBottomLeft, aV6, aV4, -aRight);
// Right
addTriangle (10, aV3, aV7, aTopRight, -aRight);
addTriangle (11, aV3, aV2, aV7, -aRight);
addTriangle (10, aV3, aTopRight, aV7, aRight);
addTriangle (11, aV3, aV7, aV2, aRight);
}
//=======================================================================
@@ -1323,8 +1322,7 @@ void AIS_Manipulator::Sector::Init (const Standard_ShortReal theRadius,
gp_Ax3 aSystem(thePosition.Location(), thePosition.Direction(), theXDirection);
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
myArray = aTool.CreateTriangulation (aTrsf);
myTriangulation = aTool.CreatePolyTriangulation (aTrsf);
aTool.FillArray(myArray, myTriangulation, aTrsf);
}
//=======================================================================
@@ -1376,8 +1374,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myAxisRadius * 1.5,
anArrowLength,
myFacettesNumber);
myTranslatorGroup = thePrs->NewGroup();
myTranslatorGroup->SetClosed (true);
myTranslatorGroup = thePrs->NewGroup ();
myTranslatorGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
myTranslatorGroup->AddPrimitiveArray (myTriangleArray);
@@ -1390,7 +1387,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myHighlightTranslator->Clear();
}
{
Handle(Graphic3d_Group) aGroup = myHighlightTranslator->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightTranslator);
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
aGroup->AddPrimitiveArray (myTriangleArray);
}
@@ -1401,8 +1398,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myCubePos = myReferenceAxis.Direction().XYZ() * (myLength + myIndent);
myCube.Init (gp_Ax1 (myCubePos, myReferenceAxis.Direction()), myBoxSize);
myScalerGroup = thePrs->NewGroup();
myScalerGroup->SetClosed (true);
myScalerGroup = thePrs->NewGroup ();
myScalerGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
myScalerGroup->AddPrimitiveArray (myCube.Array());
@@ -1415,7 +1411,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myHighlightScaler->Clear();
}
{
Handle(Graphic3d_Group) aGroup = myHighlightScaler->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightScaler);
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
aGroup->AddPrimitiveArray (myCube.Array());
}
@@ -1438,7 +1434,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myHighlightRotator->Clear();
}
{
Handle(Graphic3d_Group) aGroup = myHighlightRotator->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (myHighlightRotator);
aGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
aGroup->AddPrimitiveArray (myCircle.Array());
}
@@ -1470,7 +1466,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
myHighlightDragger->Clear();
}
{
Handle(Graphic3d_Group) aGroup = myHighlightDragger->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(myHighlightDragger);
aGroup->SetGroupPrimitivesAspect(aFillArea);
aGroup->AddPrimitiveArray(mySector.Array());
}

View File

@@ -258,7 +258,7 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
{
ComputeFrame();
Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
gp_Pnt p1;
const Standard_Real Xmax = 0.5*Standard_Real(theaspect->PlaneXLength());

View File

@@ -91,7 +91,7 @@ void AIS_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
StdPrs_Point::Add(aPresentation,myComponent,myDrawer);
else if (aMode== -99)
{
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
TheGroup->SetPrimitivesAspect (myHilightDrawer->PointAspect()->Aspect());
Handle(Graphic3d_ArrayOfPoints) aPoint = new Graphic3d_ArrayOfPoints (1);
aPoint->AddVertex (myComponent->X(),myComponent->Y(),myComponent->Z());

View File

@@ -22,6 +22,7 @@
#include <Prs3d_Drawer.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_Presentations.hxx>
#include <Select3D_SensitiveBox.hxx>

View File

@@ -24,6 +24,7 @@
#include <Graphic3d_TransModeFlags.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_Viewer.hxx>

View File

@@ -42,6 +42,7 @@
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_BndBox.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>

View File

@@ -299,7 +299,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
if (myHasFlipping)
{
gp_Ax2 aFlippingAxes (aCenterOfLabel, myOrientation3D.Direction(), myOrientation3D.XDirection());
thePrs->CurrentGroup()->SetFlippingOptions (Standard_True, aFlippingAxes);
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_True, aFlippingAxes);
}
gp_Ax2 anOrientation = myOrientation3D;
anOrientation.SetLocation (aPosition);
@@ -308,15 +308,15 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
{
aHasOwnAnchor = Standard_False; // always not using own anchor if flipping
}
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, anOrientation, aHasOwnAnchor);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, anOrientation, aHasOwnAnchor);
if (myHasFlipping && isInit)
{
thePrs->CurrentGroup()->SetFlippingOptions (Standard_False, gp_Ax2());
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2());
}
}
else
{
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, aPosition);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, aPosition);
}
if (isInit)
@@ -328,7 +328,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
gp_Pnt aMinPnt = gp_Pnt (-aDx, -aDy, 0.0).Transformed (aLabelPlane);
gp_Pnt aMaxPnt = gp_Pnt ( aDx, aDy, 0.0).Transformed (aLabelPlane);
Graphic3d_BndBox4f& aBox = thePrs->CurrentGroup()->ChangeBoundingBox();
Graphic3d_BndBox4f& aBox = Prs3d_Root::CurrentGroup (thePrs)->ChangeBoundingBox();
aBox.Add (Graphic3d_Vec4 ((float) aMinPnt.X(), (float) aMinPnt.Y(), (float) aMinPnt.Z(), 1.0));
aBox.Add (Graphic3d_Vec4 ((float) aMaxPnt.X(), (float) aMaxPnt.Y(), (float) aMaxPnt.Z(), 1.0));
}

View File

@@ -28,6 +28,7 @@
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentationManager3d.hxx>

View File

@@ -11,14 +11,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_Triangulation.hxx>
#include <AIS_DisplayMode.hxx>
#include <AIS_Triangulation.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Standard_Type.hxx>
#include <Poly_Array1OfTriangle.hxx>
#include <Poly_Triangulation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <TShort_Array1OfShortReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
@@ -131,7 +131,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
Handle(Graphic3d_ArrayOfTriangles) anArray = new Graphic3d_ArrayOfTriangles (myNbNodes, myNbTriangles * 3,
hasVNormals, hasVColors, Standard_False);
Handle(Graphic3d_Group) TheGroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
Handle(Graphic3d_AspectFillArea3d) aspect = myDrawer->ShadingAspect()->Aspect();
Standard_Integer i;

View File

@@ -298,7 +298,7 @@ void AIS_Trihedron::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManag
aPresentation->Clear();
const Prs3d_DatumParts aPart = anOwner->DatumPart();
Handle(Graphic3d_Group) aGroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
if (aPart >= Prs3d_DP_XOYAxis && aPart <= Prs3d_DP_XOZAxis)
{
// planes selection is equal in both shading and wireframe mode
@@ -443,7 +443,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
// display origin
{
// Origin is visualized only in shading mode
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
const Prs3d_DatumParts aPart = Prs3d_DP_Origin;
if (anAspect->DrawDatumPart(aPart))
{
@@ -470,7 +470,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
continue;
}
Handle(Graphic3d_Group) anAxisGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) anAxisGroup = Prs3d_Root::NewGroup (thePrs);
myPartToGroup.Bind (aPart, anAxisGroup);
if (isShadingMode)
{
@@ -489,7 +489,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
continue;
}
Handle(Graphic3d_Group) anArrowGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
anArrowGroup->SetGroupPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
anArrowGroup->AddPrimitiveArray (arrayOfPrimitives (anArrowPart));
}
@@ -518,7 +518,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
case Prs3d_DP_ZAxis: aDir = aComponent->Direction(); break;
default: break;
}
Handle(Graphic3d_Group) aLabelGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) aLabelGroup = Prs3d_Root::NewGroup (thePrs);
const gp_Pnt aPoint = anOrigin.XYZ() + aDir.XYZ() * anAxisLength;
Prs3d_Text::Draw (aLabelGroup, anAspect->TextAspect(), aLabel, aPoint);
}
@@ -533,7 +533,7 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
continue;
}
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs);
myPartToGroup.Bind (aPart, aGroup);
aGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));

View File

@@ -24,6 +24,7 @@
#include <Prs3d.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_ToolDisk.hxx>
#include <Prs3d_ToolSphere.hxx>
@@ -598,7 +599,6 @@ void AIS_ViewCube::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
}
Handle(Graphic3d_Group) anAxisGroup = thePrs->NewGroup();
anAxisGroup->SetClosed (true);
anAxisGroup->SetGroupPrimitivesAspect (aDatumAspect->ShadingAspect (aPart)->Aspect());
const Standard_Real anArrowLength = 0.2 * anAxisSize;
@@ -621,7 +621,6 @@ void AIS_ViewCube::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
// Display center
{
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetClosed (true);
Handle(Prs3d_ShadingAspect) anAspectCen = new Prs3d_ShadingAspect();
anAspectCen->SetColor (Quantity_NOC_WHITE);
aGroup->SetGroupPrimitivesAspect (anAspectCen->Aspect());

View File

@@ -23,7 +23,6 @@
#include <Aspect_Background.hxx>
#include <Quantity_Color.hxx>
#include <Standard_Dump.hxx>
//-Aliases
//-Global data definitions
@@ -57,14 +56,3 @@ Quantity_Color Aspect_Background::Color () const {
return (MyColor);
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_Background)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
}

View File

@@ -46,9 +46,6 @@ public:
//! Returns the colour of the window background <me>.
Standard_EXPORT Quantity_Color Color() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -140,20 +140,3 @@ void Aspect_CircularGrid::Init () {
myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
}

View File

@@ -55,9 +55,6 @@ public:
Standard_EXPORT Standard_Integer DivisionNumber() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -18,8 +18,6 @@
#include <Aspect_GenId.hxx>
#include <Aspect_IdentDefinitionError.hxx>
#include <Standard_Dump.hxx>
// =======================================================================
// function : Aspect_GenId
// purpose :
@@ -116,21 +114,3 @@ Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
theId = myLowerBound + myLength - myFreeCount - 1;
return Standard_True;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
{
Standard_Integer aFreeId = anIter.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
}
}

View File

@@ -72,9 +72,6 @@ public:
//! Returns the upper identifier in range.
Standard_Integer Upper() const { return myUpperBound; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:

View File

@@ -55,18 +55,3 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
{
return MyGradientMethod;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_GradientBackground)
Quantity_Color aColor = Color();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aColor)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
}

View File

@@ -51,9 +51,6 @@ public:
//! Returns the current gradient background fill mode.
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -104,22 +104,3 @@ void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
myDrawMode = theDrawMode;
UpdateDisplay();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
}

View File

@@ -96,9 +96,6 @@ public:
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
Standard_EXPORT virtual void Init() = 0;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -155,25 +155,3 @@ Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
const Standard_Real beta) const {
return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
}

View File

@@ -67,9 +67,6 @@ public:
Standard_EXPORT Standard_Real SecondAngle() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -92,18 +92,3 @@ void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
{
MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
}

View File

@@ -114,9 +114,6 @@ public:
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)

View File

@@ -145,7 +145,8 @@ Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices
Standard_Integer nV;
if (nSD != -1) {
// update old SD vertex with new value
BRep_TVertex* aTVertex = static_cast<BRep_TVertex*>(aVSD.TShape().get());
Handle(BRep_TVertex)& aTVertex =
reinterpret_cast<Handle(BRep_TVertex)&>(const_cast<Handle(TopoDS_TShape)&>(aVSD.TShape()));
aTVertex->Pnt(BRep_Tool::Pnt(aVn));
aTVertex->Tolerance(BRep_Tool::Tolerance(aVn));
aVn = aVSD;

View File

@@ -3328,7 +3328,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
Standard_Real aTolE = BRep_Tool::Tolerance(aE);
if (aTolC < aTolE) {
// reduce edge tolerance
static_cast<BRep_TEdge*>(aE.TShape().get())->Tolerance(aTolC);
reinterpret_cast<BRep_TEdge*>(aE.TShape().operator->())->Tolerance(aTolC);
bIsReduced = Standard_True;
}
}
@@ -3446,7 +3446,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
}
//
if (aMaxTol < aTolV) {
static_cast<BRep_TVertex*>(aV.TShape().get())->Tolerance(aMaxTol);
reinterpret_cast<BRep_TVertex*>(aV.TShape().operator->())->Tolerance(aMaxTol);
}
}
}

View File

@@ -18,7 +18,9 @@
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <Adaptor3d_HVertex.hxx>
#include <BRepAdaptor_HCurve2d.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <BRepBlend_BlendTool.hxx>
#include <BRepBlend_HCurve2dTool.hxx>
#include <BRepClass_FaceClassifier.hxx>
@@ -134,3 +136,19 @@ void BRepBlend_BlendTool::Bounds(const Handle(Adaptor2d_HCurve2d)& A,
Ufirst = BRepBlend_HCurve2dTool::FirstParameter(A);
Ulast = BRepBlend_HCurve2dTool::LastParameter(A);
}
//=======================================================================
//function : IsSeam
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_BlendTool::IsSeam(const Handle(Adaptor2d_HCurve2d)& C)
{
Handle(BRepAdaptor_HCurve2d) brhc =
Handle(BRepAdaptor_HCurve2d)::DownCast(C);
if (brhc.IsNull())
return Standard_False;
return BRepTools::IsReallyClosed(((BRepAdaptor_Curve2d *)&(brhc->Curve2d()))->Edge(),
((BRepAdaptor_Curve2d *)&(brhc->Curve2d()))->Face());
}

View File

@@ -76,6 +76,10 @@ public:
//! or a bounding box for an infinite arc.
Standard_EXPORT static void Bounds (const Handle(Adaptor2d_HCurve2d)& C, Standard_Real& Ufirst, Standard_Real& Ulast);
//! Returns the status of edge:
//! is it a seam edge or not
Standard_EXPORT static Standard_Boolean IsSeam (const Handle(Adaptor2d_HCurve2d)& C);
static Handle(Adaptor2d_HCurve2d) CurveOnSurf (const Handle(Adaptor2d_HCurve2d)& C, const Handle(Adaptor3d_HSurface)& S);

View File

@@ -2923,46 +2923,38 @@ 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);
if (!PerformCorner(IFirst,
Transition, Bounds))
{
isDone = Standard_False;
return;
}
}
IFirst = ILast;
Translate(myVEdges, IFirst, Bounds, 1);
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);
}
}
// 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);
if (!PerformCorner(1, Transition, Bounds))
{
isDone = Standard_False;
return;
}
PerformCorner(1, Transition, Bounds);
Translate(myVEdges, 1, myVEdges, NbPath+1);
}
@@ -3183,14 +3175,12 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
//function : PerformCorner
//purpose : Trim and/or loop a corner
//======================================================================
Standard_Boolean BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
const BRepFill_TransitionStyle Transition,
const Handle(TopTools_HArray2OfShape)& Bounds)
void BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
const BRepFill_TransitionStyle Transition,
const Handle(TopTools_HArray2OfShape)& Bounds)
{
if (Transition == BRepFill_Modified) return Standard_True; // Do nothing.
const Standard_Real anAngularTol = 0.025;
if (Transition == BRepFill_Modified) return; // Do nothing.
BRepFill_TransitionStyle TheTransition = Transition;
Standard_Boolean isTangent=Standard_False;
@@ -3236,15 +3226,11 @@ 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 Standard_True;
return;
}
Sortant = t2 - t1;
}
if (T1.Angle(T2) >= M_PI - anAngularTol)
{
return Standard_False;
}
if ((TheTransition == BRepFill_Right)
&& (T1.Angle(T2) > myAngMax) ) {
TheTransition = BRepFill_Round;
@@ -3350,7 +3336,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
#ifdef OCCT_DEBUG
std::cout << "Fail of TrimCorner" << std::endl;
#endif
return Standard_True; // Nothing is touched
return; // Nothing is touched
}
if (mySec->IsUClosed())
@@ -3430,7 +3416,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
#endif
}
}
return Standard_True;
/*
#if DRAW
if (Affich) {

View File

@@ -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 Standard_Boolean PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
Standard_EXPORT void 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;

View File

@@ -41,7 +41,15 @@ Standard_Integer Blend_Walking::ArcToRecadre(const Standard_Boolean OnFirst,
lastpt2d.SetCoord(uprev,vprev);
Iter->Init();
while (Iter->More()) {
nbarc++; ok = 0;
if (TheBlendTool::IsSeam(Iter->Value()))
{
Iter->Next();
continue;
}
if (OnFirst) {
if(byinter) {
ok = okinter = TheBlendTool::Inters(pt2d,lastpt2d,

View File

@@ -200,10 +200,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
rsnld.Root(sol);
if(clasonS1) situ1 = domain1->Classify(gp_Pnt2d(sol(1),sol(2)),
Min(tolerance(1),tolerance(2)),0);
Min(tolerance(1),tolerance(2)),Standard_True/*0*/);
else situ1 = TopAbs_IN;
if(clasonS2) situ2 = domain2->Classify(gp_Pnt2d(sol(3),sol(4)),
Min(tolerance(3),tolerance(4)),0);
Min(tolerance(3),tolerance(4)),Standard_True/*0*/);
else situ2 = TopAbs_IN;
}
if(bonpoint && line->NbPoints() == 1 && (situ1 != TopAbs_IN || situ2 != TopAbs_IN)){

View File

@@ -144,7 +144,8 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace2,
const GeomAbs_Shape Order)
{
if (Order == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
if (Order > GeomAbs_C0 &&
BRep_Tool::Continuity( theEdge, theFace1, theFace2 ) >= Order)
return Standard_True;
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));

View File

@@ -45,6 +45,8 @@
#include <ChFiDS_Stripe.hxx>
#include <ChFiDS_SurfData.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <GCE2d_MakeLine.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt2d.hxx>
#include <Precision.hxx>
@@ -68,6 +70,8 @@
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
//#include <BRepAlgoAPI_Fuse.hxx>
#include <BOPAlgo_Builder.hxx>
#include <TopOpeBRepBuild_HBuilder.hxx>
#include <TopOpeBRepDS_BuildTool.hxx>
#include <TopOpeBRepDS_Curve.hxx>
@@ -79,6 +83,9 @@
#include <TopOpeBRepDS_PointIterator.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfOrientedShape.hxx>
#include <BRepTools_ReShape.hxx>
#include <BRepTools.hxx>
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
@@ -107,6 +114,450 @@ extern Standard_Boolean ChFi3d_GettraceCHRON();
#endif
//=======================================================================
//function : NearestWholePeriod
//purpose :
//=======================================================================
Standard_Real NearestWholePeriod(const Standard_Real theValue,
const Standard_Real thePeriod,
const Standard_Boolean theFromBelow)
{
Standard_Real Result = 0.;
Standard_Real Sign = (theValue < 0.)? -1 : 1;
while (Abs(Result - theValue) > thePeriod)
Result += Sign * thePeriod;
if (Result > theValue && theFromBelow)
Result -= thePeriod;
return Result;
}
//=======================================================================
//function : FindPeriod
//purpose :
//=======================================================================
Standard_Real FindPeriod(const TopoDS_Face& theFace,
const Standard_Boolean theIsUdirection)
{
Standard_Real aPeriod = 0.;
BRepAdaptor_Surface BAsurf(theFace, Standard_False);
if (theIsUdirection)
{
if (BAsurf.IsUPeriodic())
aPeriod = BAsurf.UPeriod();
else
{
Standard_Real Umin = BAsurf.FirstUParameter(),
Umax = BAsurf.LastUParameter();
aPeriod = Umax - Umin;
}
}
else
{
//temporary
}
return aPeriod;
}
//=======================================================================
//function : ContainsEdge
//purpose :
//=======================================================================
Standard_Boolean ContainsEdge(const TopoDS_Shape& theShape,
const TopoDS_Shape& theEdge)
{
TopExp_Explorer Explo(theShape, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Shape& anEdge = Explo.Current();
if (anEdge.IsSame(theEdge))
return Standard_True;
}
return Standard_False;
}
//=======================================================================
//function : FindProperSubShape
//purpose :
//=======================================================================
TopoDS_Shape FindProperSubShape(const TopoDS_Shape& theNewFace,
const TopoDS_Shape& theShape)
{
TopoDS_Shape NullShape;
TopTools_IndexedMapOfShape Emap;
TopExp::MapShapes(theNewFace, TopAbs_EDGE, Emap);
TopoDS_Iterator iter(theShape);
for (; iter.More(); iter.Next())
{
const TopoDS_Shape& aShape = iter.Value();
if (aShape.ShapeType() == TopAbs_FACE)
{
TopExp_Explorer Explo(aShape, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Shape& anEdge = Explo.Current();
if (Emap.Contains(anEdge))
return theShape;
}
}
else
{
TopoDS_Shape aResult = FindProperSubShape(theNewFace, aShape);
if (!aResult.IsNull())
return aResult;
}
}
return NullShape;
}
//=======================================================================
//function : DeleteEdgesFromMap
//purpose :
//=======================================================================
void DeleteEdgesFromMap(TopTools_IndexedDataMapOfShapeListOfShape& theVEmap,
const TopTools_SequenceOfShape& theEdges,
//const TopoDS_Edge& theCurEdge,
const TopoDS_Edge& theNextEdge,
const TopoDS_Vertex& theVertex,
const Standard_Integer theIndOr)
{
for (Standard_Integer i = 1; i <= theEdges.Length(); i++)
{
const TopoDS_Edge& anEdge = TopoDS::Edge(theEdges(i));
if (anEdge == theNextEdge)
continue;
TopoDS_Vertex VV [2];
TopExp::Vertices(anEdge, VV[0], VV[1], Standard_True);
if (VV[theIndOr].IsSame(theVertex))
{
//theDeletedEdges.Append(anEdge);
for (Standard_Integer j = 1; j <= theVEmap.Extent(); j++)
{
TopoDS_Vertex aVertex = TopoDS::Vertex(theVEmap.FindKey(j));
TopTools_ListIteratorOfListOfShape itl(theVEmap(j));
for (; itl.More(); itl.Next())
{
if (anEdge == itl.Value())
{
theVEmap(j).Remove(itl);
break;
}
}
}
}
}
}
//=======================================================================
//function : BuildNewWire
//purpose :
//=======================================================================
TopoDS_Wire BuildNewWire(const TopoDS_Wire& theWire,
TopTools_IndexedDataMapOfShapeListOfShape& theVEmap,
//const TopoDS_Compound& theNewEdges,
const TopTools_IndexedMapOfShape& theNewEdges,
const TopoDS_Face& theFace)
{
//Temporary
BRep_Builder BB;
TopoDS_Compound aNE;
BB.MakeCompound(aNE);
for (Standard_Integer ind = 1; ind <= theNewEdges.Extent(); ind++)
{
const TopoDS_Shape& aNewEdge = theNewEdges(ind);
BB.Add(aNE, aNewEdge);
}
///////////
Standard_Boolean Uclosed, Vclosed;
Standard_Real Uperiod = 0., Vperiod = 0.;
BRepTools::DetectClosedness(theFace, Uclosed, Vclosed);
if (Uclosed)
Uperiod = FindPeriod(theFace, Standard_True);
if (Vclosed)
Vperiod = FindPeriod(theFace, Standard_False);
TopTools_IndexedMapOfShape OldVertices;
TopExp::MapShapes(theWire, TopAbs_VERTEX, OldVertices);
//TopExp::MapShapes(theNewEdges, TopAbs_EDGE, NewEdges);
//Find <StartEdge>, <StartVertex> and calculate minimum distance
//between extremities of edge in 2d
TopoDS_Vertex StartVertex;
TopoDS_Edge StartEdge, SecondEdge;
Standard_Real MinDist = RealLast();
TopTools_ListIteratorOfListOfShape itl;
TopTools_MapOfOrientedShape Emap;
for (Standard_Integer i = 1; i <= OldVertices.Extent(); i++)
{
TopoDS_Vertex aVertex = TopoDS::Vertex(OldVertices(i));
const TopTools_ListOfShape& Elist = theVEmap.FindFromKey(aVertex);
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value());
if (!Emap.Add(anEdge))
continue;
if (StartEdge.IsNull() &&
theNewEdges.Contains(anEdge))
{
//StartEdge = anEdge;
Standard_Integer anIndex = theNewEdges.FindIndex(anEdge);
StartEdge = TopoDS::Edge(theNewEdges(anIndex));
StartVertex = aVertex;
}
BRepAdaptor_Curve2d BAcurve(anEdge, theFace);
gp_Pnt2d aFirstPoint = BAcurve.Value(BAcurve.FirstParameter());
gp_Pnt2d aLastPoint = BAcurve.Value(BAcurve.LastParameter());
Standard_Real aDist = aFirstPoint.SquareDistance(aLastPoint);
if (aDist < MinDist)
MinDist = aDist;
}
}
if (StartEdge.IsNull())
return theWire;
TopoDS_Wire NewWire;
//BRep_Builder BB;
BB.MakeWire(NewWire);
BB.Add(NewWire, StartEdge);
//Define the direction of loop: forward or reversed
TopAbs_Orientation Direction;
Standard_Integer IndOr;
//Here and further orientation of edge is taken into account
TopoDS_Vertex V1 = TopExp::FirstVertex(StartEdge, Standard_True);
if (V1.IsSame(StartVertex))
{
Direction = TopAbs_FORWARD;
IndOr = 0;
}
else
{
Direction = TopAbs_REVERSED;
IndOr = 1;
}
BRepAdaptor_Curve2d StartBAcurve(StartEdge, theFace);
Standard_Real StartParam = BRep_Tool::Parameter(StartVertex, StartEdge);
gp_Pnt2d StartPoint = StartBAcurve.Value(StartParam);
//Find second edge;
TopTools_SequenceOfShape Candidates; //, DeletedEdges;
TopoDS_Vertex VV [2];
//Main loop
TopoDS_Edge CurEdge = StartEdge, PrevEdge;
TopoDS_Vertex CurVertex = (Direction == TopAbs_FORWARD)?
TopExp::LastVertex(CurEdge, Standard_True) :
TopExp::FirstVertex(CurEdge, Standard_True);
BRepAdaptor_Curve2d CurCurve(CurEdge, theFace);
Standard_Real CurParam = BRep_Tool::Parameter(CurVertex, CurEdge);
gp_Pnt2d CurPoint = CurCurve.Value(CurParam);
Standard_Boolean IsPrevSeamJustBuilt = Standard_False;
for (;;)
{
const TopTools_ListOfShape& Elist = theVEmap.FindFromKey(CurVertex);
Candidates.Clear();
Standard_Boolean ToAdd = Standard_True;
//Standard_Boolean IsPrevEdgeCorrect = Standard_True;
//Candidates are the edges close to <CurPoint> in 2d
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value());
if (anEdge.IsSame(CurEdge))
continue;
BRepAdaptor_Curve2d BAcurve(anEdge, theFace);
gp_Pnt2d aPoint = BAcurve.Value(BAcurve.FirstParameter());
Standard_Real aDist = CurPoint.SquareDistance(aPoint);
if (aDist < MinDist)
Candidates.Append(anEdge);
else
{
aPoint = BAcurve.Value(BAcurve.LastParameter());
aDist = CurPoint.SquareDistance(aPoint);
if (aDist < MinDist)
Candidates.Append(anEdge);
}
}
TopoDS_Edge NextEdge, aCandidate;
if (Candidates.IsEmpty()) //hanging edge
{
//need to build additional edges
Standard_Real fpar, lpar;
if (BRep_Tool::Degenerated(CurEdge) &&
!BRep_Tool::Degenerated(PrevEdge))
{
//enlarge current degenerated edge
TopoDS_Vertex OtherVertex = CurVertex;
OtherVertex.Reverse();
Standard_Real OtherParam = BRep_Tool::Parameter(OtherVertex, CurEdge);
gp_Pnt2d OtherPoint = CurCurve.Value(OtherParam);
if (Uclosed)
{
Standard_Real DirOfCurEdge = CurPoint.X() - OtherPoint.X();
Standard_Boolean FromBelow = (DirOfCurEdge < 0.);
Standard_Real NewX = NearestWholePeriod( CurPoint.X(), Uperiod, FromBelow );
CurPoint.SetX(NewX);
}
Handle(Geom2d_Line) aLine;
if (CurEdge.Orientation() == TopAbs_FORWARD)
aLine = GCE2d_MakeLine(OtherPoint, CurPoint);
else
aLine = GCE2d_MakeLine(CurPoint, OtherPoint);
BB.UpdateEdge(CurEdge, aLine, theFace, 0.);
BB.Range(CurEdge, 0., CurPoint.Distance(OtherPoint));
NextEdge = CurEdge;
IsPrevSeamJustBuilt = Standard_False;
ToAdd = Standard_False;
}
else if (IsPrevSeamJustBuilt)
{
//Find degenerated edge and enlarge it
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
if (anEdge.IsSame(CurEdge))
continue;
if (BRep_Tool::Degenerated(anEdge))
{
//enlarge found degenerated edge
TopoDS_Vertex OtherVertex = CurVertex;
if (anEdge.Orientation() == TopAbs_FORWARD)
OtherVertex.Reverse();
Standard_Real OtherParam = BRep_Tool::Parameter(OtherVertex, anEdge);
BRepAdaptor_Curve2d aCurve(anEdge, theFace);
gp_Pnt2d OtherPoint = aCurve.Value(OtherParam);
Handle(Geom2d_Line) aLine;
if (anEdge.Orientation() == TopAbs_FORWARD)
aLine = GCE2d_MakeLine(OtherPoint, CurPoint);
else
aLine = GCE2d_MakeLine(CurPoint, OtherPoint);
BB.UpdateEdge(anEdge, aLine, theFace, 0.);
BB.Range(anEdge, 0., CurPoint.Distance(OtherPoint));
NextEdge = anEdge;
IsPrevSeamJustBuilt = Standard_False;
}
}
}
else
{
//build additional seam edge from existing edge
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
if (anEdge.IsSame(CurEdge))
continue;
TopExp::Vertices(anEdge, VV[0], VV[1], Standard_True);
if (VV[1-IndOr].IsSame(CurVertex))
{
if (!BRep_Tool::IsClosed(anEdge, theFace))
{
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
Standard_Real aParam = BRep_Tool::Parameter(CurVertex, anEdge);
gp_Pnt2d aPoint = aPCurve->Value(aParam);
gp_Vec2d Offset(0.,0.);
if (Uclosed)
Offset.SetX( CurPoint.X() - aPoint.X() );
else
Offset.SetY( CurPoint.Y() - aPoint.Y() );
Handle(Geom2d_Curve) aPCurve2 = Handle(Geom2d_Curve)::DownCast(aPCurve->Translated(Offset));
BB.UpdateEdge(anEdge, aPCurve, aPCurve2, theFace, 0.);
}
NextEdge = TopoDS::Edge(anEdge.Reversed());
IsPrevSeamJustBuilt = Standard_True;
break;
}
}
}
}
for (Standard_Integer i = 1; i <= Candidates.Length(); i++)
{
IsPrevSeamJustBuilt = Standard_False;
const TopoDS_Edge& anEdge = TopoDS::Edge(Candidates(i));
if (theNewEdges.Contains(anEdge))
{
TopExp::Vertices(anEdge, VV[0], VV[1], Standard_True);
if (VV[IndOr].IsSame(CurVertex))
{
BRepAdaptor_Curve2d BAcurve(anEdge, theFace);
Standard_Real aParam = BRep_Tool::Parameter(CurVertex, anEdge);
gp_Pnt2d aPoint = BAcurve.Value(aParam);
Standard_Real aDist = CurPoint.SquareDistance(aPoint);
if (aDist < MinDist)
{
NextEdge = anEdge;
break;
}
}
else //previous edge is incorrect
{
//error ?
//remove previous edge from wire
//build additional edges
//NextEdge = anEdge;
}
}
else if (aCandidate.IsNull())
{
TopExp::Vertices(anEdge, VV[0], VV[1], Standard_True);
if (VV[IndOr].IsSame(CurVertex))
{
BRepAdaptor_Curve2d BAcurve(anEdge, theFace);
Standard_Real aParam = BRep_Tool::Parameter(VV[IndOr], anEdge);
gp_Pnt2d aPoint = BAcurve.Value(aParam);
Standard_Real aDist = CurPoint.SquareDistance(aPoint);
if (aDist < MinDist)
aCandidate = anEdge;
}
}
}
if (NextEdge.IsNull())
NextEdge = aCandidate;
DeleteEdgesFromMap(theVEmap, Candidates, NextEdge, CurVertex, 1-IndOr);
PrevEdge = CurEdge;
CurEdge = NextEdge;
CurVertex = (Direction == TopAbs_FORWARD)?
TopExp::LastVertex(CurEdge, Standard_True) :
TopExp::FirstVertex(CurEdge, Standard_True);
CurCurve.Initialize(CurEdge, theFace);
CurParam = BRep_Tool::Parameter(CurVertex, CurEdge);
CurPoint = CurCurve.Value(CurParam);
if (ToAdd)
BB.Add(NewWire, CurEdge);
if (CurVertex.IsSame(StartVertex) &&
CurPoint.SquareDistance(StartPoint) < MinDist)
break;
}
return NewWire;
}
//=======================================================================
//function : CompleteDS
//purpose :
@@ -372,7 +823,7 @@ void ChFi3d_Builder::Compute()
if (done) {
BRep_Builder B1;
BRep_Builder BB;
CompleteDS(DStr,myShape);
//Update tolerances on vertex to max adjacent edges or
//Update tolerances on degenerated edge to max of adjacent vertexes.
@@ -398,7 +849,7 @@ void ChFi3d_Builder::Compute()
if( tolc < tolv ) tolc = tolv + 0.00001;
}
if(degen && tolc < tolv) tolc = tolv;
else if(tolc>tolv) B1.UpdateVertex(v,tolc);
else if(tolc>tolv) BB.UpdateVertex(v,tolc);
}
else if(gk == TopOpeBRepDS_POINT){
TopOpeBRepDS_Point& p = DStr.ChangePoint(gi);
@@ -409,7 +860,330 @@ void ChFi3d_Builder::Compute()
}
if(degen) c.Tolerance(tolc);
}
//jgv
//for (on modified faces)
//compound of wires from each face
//compound of new edges for this face
//general fuse (compound of wires from a face, compound of new edges for this face)
//method building new face from old and new edges
//assembling of resulting shape from modified and unmodified faces.
TopTools_ListOfShape aChFiFaces;
TopTools_IndexedDataMapOfShapeShape aFacesModifiedFaces;
TopTools_IndexedMapOfShape MapNewEdges;
//TopTools_DataMapOfShapeListOfShape FaceListEdges;
NCollection_DataMap<TopoDS_Shape, TopTools_IndexedMapOfShape> FaceMapEdges;
BOPAlgo_Builder GenFuse;
for (Standard_Integer i = 1; i <= myNewFaces.Extent(); i++)
{
TopoDS_Face aFace = TopoDS::Face(myNewFaces(i));
//TopAbs_Orientation anOrOfFace = aFace.Orientation();
aFace.Orientation(TopAbs_FORWARD);
TopTools_IndexedMapOfShape* aEmap = FaceMapEdges.Bound(aFace, TopTools_IndexedMapOfShape());
//TopoDS_Compound aNewEdges;
//BB.MakeCompound(aNewEdges);
//TopTools_ListOfShape ListNewEdges;
//ChFi3d_ListIteratorOfListOfQualifiedEdge itl(myFaceNewEdges.FindFromKey(i));
TColStd_ListIteratorOfListOfInteger itl(myFaceNewEdges.FindFromKey(i));
for (; itl.More(); itl.Next())
{
Standard_Integer aSignedIndex = itl.Value();
Standard_Integer anIndex = Abs(aSignedIndex);
TopoDS_Shape aNewEdge = myNewEdges(anIndex);
TopAbs_Orientation anOr = (aSignedIndex > 0)?
TopAbs_FORWARD : TopAbs_REVERSED;
aNewEdge.Orientation(anOr);
//BB.Add(aNewEdges, aNewEdge);
//ListNewEdges.Append(aNewEdge);
aEmap->Add(aNewEdge);
}
if (myIndsChFiFaces.Contains(i)) //absolutely new face
{
}
else //a modified old face
{
GenFuse.AddArgument(aFace);
//TopTools_ListIteratorOfListOfShape itl(ListNewEdges);
//for (; itl.More(); itl.Next())
//MapNewEdges.Add(itl.Value());
for (Standard_Integer iedge = 1; iedge <= aEmap->Extent(); iedge++)
MapNewEdges.Add(aEmap->FindKey(iedge));
}
}
//Fusing
//GenFuse.AddArgument(aNewEdges);
for (Standard_Integer i = 1; i <= MapNewEdges.Extent(); i++)
GenFuse.AddArgument(MapNewEdges(i));
GenFuse.Perform();
//Temporary
const TopoDS_Shape& aResFuse = GenFuse.Shape();
///////////
const TopTools_DataMapOfShapeListOfShape& ModifiedShapes = GenFuse.Images();
for (Standard_Integer i = 1; i <= myNewFaces.Extent(); i++)
{
TopoDS_Face aFace = TopoDS::Face(myNewFaces(i));
TopAbs_Orientation anOrOfFace = aFace.Orientation();
aFace.Orientation(TopAbs_FORWARD);
if (myIndsChFiFaces.Contains(i)) //absolutely new face
{
TopoDS_Wire aWire;
BB.MakeWire(aWire);
for (Standard_Integer iedge = 1; iedge <= FaceMapEdges(aFace).Extent(); iedge++)
{
const TopoDS_Shape& anEdge = FaceMapEdges(aFace).FindKey(iedge);
TopAbs_Orientation anOr = anEdge.Orientation();
if (ModifiedShapes.IsBound(anEdge))
{
const TopTools_ListOfShape& aListOfSplits = ModifiedShapes(anEdge);
TopTools_ListIteratorOfListOfShape itl(aListOfSplits);
for (; itl.More(); itl.Next())
BB.Add(aWire, itl.Value().Oriented(anOr));
}
else
BB.Add(aWire, anEdge);
}
BB.Add(aFace, aWire);
aFace.Orientation(anOrOfFace);
aChFiFaces.Append(aFace);
}
else //modify old face
{
//Build compound for construction of new face
const TopTools_ListOfShape& aListOfModifiedFromFace = ModifiedShapes(aFace);
TopoDS_Compound ResFuseForFace;
BB.MakeCompound(ResFuseForFace);
TopTools_ListIteratorOfListOfShape itl(aListOfModifiedFromFace);
for (; itl.More(); itl.Next())
BB.Add(ResFuseForFace, itl.Value());
//Update FaceMapEdges(aFace)
TopTools_ListOfShape ToDelete, ToAdd;
for (Standard_Integer ind = 1; ind <= FaceMapEdges(aFace).Extent(); ind++)
{
const TopoDS_Shape& aNewEdgeOfFace = FaceMapEdges(aFace)(ind);
TopAbs_Orientation anOr = aNewEdgeOfFace.Orientation();
if (ModifiedShapes.IsBound(aNewEdgeOfFace))
{
const TopTools_ListOfShape& aListOfSplits = ModifiedShapes(aNewEdgeOfFace);
for (itl.Initialize(aListOfSplits); itl.More(); itl.Next())
ToAdd.Append(itl.Value().Oriented(anOr));
ToDelete.Append(aNewEdgeOfFace);
}
}
for (itl.Initialize(ToDelete); itl.More(); itl.Next())
FaceMapEdges(aFace).RemoveKey(itl.Value());
for (itl.Initialize(ToAdd); itl.More(); itl.Next())
FaceMapEdges(aFace).Add(itl.Value());
//Build the map of splits for edges of old face
TopTools_MapOfShape Splits;
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Shape& anEdge = Explo.Current();
if (ModifiedShapes.IsBound(anEdge))
{
const TopTools_ListOfShape& aListOfSplits = ModifiedShapes(anEdge);
for (itl.Initialize(aListOfSplits); itl.More(); itl.Next())
Splits.Add(itl.Value());
}
}
ToDelete.Clear();
for (Standard_Integer ind = 1; ind <= FaceMapEdges(aFace).Extent(); ind++)
{
const TopoDS_Shape& aNewEdgeOfFace = FaceMapEdges(aFace)(ind);
if (Splits.Contains(aNewEdgeOfFace))
{
ToDelete.Append(aNewEdgeOfFace);
continue;
}
TopAbs_Orientation anOr = aNewEdgeOfFace.Orientation();
if (ModifiedShapes.IsBound(aNewEdgeOfFace))
{
const TopTools_ListOfShape& aListOfModifiedFromEdge = ModifiedShapes(aNewEdgeOfFace);
for (itl.Initialize(aListOfModifiedFromEdge); itl.More(); itl.Next())
{
const TopoDS_Shape& aModifiedNewEdgeOfFace = itl.Value();
if (!ContainsEdge(ResFuseForFace, aModifiedNewEdgeOfFace))
BB.Add(ResFuseForFace, aModifiedNewEdgeOfFace.Oriented(anOr));
}
}
else
BB.Add(ResFuseForFace, aNewEdgeOfFace);
}
for (itl.Initialize(ToDelete); itl.More(); itl.Next())
FaceMapEdges(aFace).RemoveKey(itl.Value());
TopTools_IndexedDataMapOfShapeListOfShape VEmapOfNewFace;
TopExp::MapShapesAndUniqueAncestors(ResFuseForFace, TopAbs_VERTEX, TopAbs_EDGE,
VEmapOfNewFace, Standard_True); //with orientation
TopoDS_Shape aNewFace = aFace.EmptyCopied();
TopoDS_Iterator itw(aFace);
for (; itw.More(); itw.Next())
{
const TopoDS_Shape& aWire = itw.Value();
TopTools_ListOfShape ListOfWires;
if (ModifiedShapes.IsBound(aWire))
{
const TopTools_ListOfShape& aListOfModified = ModifiedShapes(aWire);
for (itl.Initialize(aListOfModified); itl.More(); itl.Next())
ListOfWires.Append(itl.Value());
}
else
ListOfWires.Append(aWire);
for (itl.Initialize(ListOfWires); itl.More(); itl.Next())
{
const TopoDS_Wire& aModifiedWire = TopoDS::Wire(itl.Value());
#ifdef OCCT_DEBUG
std::cout << "a Modified Wire ..." << std::endl;
#endif
//Temporary
TopoDS_Face TmpFace = TopoDS::Face(aFace.EmptyCopied());
BB.Add(TmpFace, aModifiedWire);
///////////
//TopoDS_Wire aNewWire = BuildNewWire(aModifiedWire, VEmapOfNewFace, aNewEdges, aFace);
TopoDS_Wire aNewWire = BuildNewWire(aModifiedWire, VEmapOfNewFace, FaceMapEdges(aFace), aFace);
#ifdef OCCT_DEBUG
std::cout << "a New Wire ..." << std::endl;
#endif
BB.Add(aNewFace, aNewWire);
#ifdef OCCT_DEBUG
std::cout << "a New Face ..." << std::endl;
#endif
aFacesModifiedFaces.Add(aFace, aNewFace);
}
}
}
}
//Update ChFiFaces
/*
TopTools_ListOfShape ModifiedChFiFaces;
TopTools_ListIteratorOfListOfShape itl(aChFiFaces);
while (itl.More())
{
TopoDS_Shape aChFiFace = itl.Value();
TopAbs_Orientation anOrOfFace = aChFiFace.Orientation();
aChFiFace.Orientation(TopAbs_FORWARD);
BRepTools_Substitution aSubstitutor;
TopExp_Explorer Explo(aChFiFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Shape& anEdge = Explo.Current();
if (!ModifiedShapes.IsBound(anEdge))
continue;
const TopTools_ListOfShape& aListOfSplits = ModifiedShapes(anEdge);
TopTools_ListIteratorOfListOfShape itspl(aListOfSplits);
for (; itspl.More(); itspl.Next())
{
const TopoDS_Shape& aSplit = itspl.Value();
cout<<"a Split..."<<endl;
}
aSubstitutor.Substitute(anEdge.Oriented(TopAbs_FORWARD), aListOfSplits);
}
aSubstitutor.Build(aChFiFace);
if (aSubstitutor.IsCopied(aChFiFace))
{
const TopTools_ListOfShape& listSh = aSubstitutor.Copy(aChFiFace);
TopoDS_Shape aNewChFiFace = listSh.First();
aNewChFiFace.Orientation(anOrOfFace);
ModifiedChFiFaces.Append(aNewChFiFace);
aChFiFaces.Remove(itl);
}
else
itl.Next();
}
aChFiFaces.Append(ModifiedChFiFaces);
*/
/*
else //a modified old face
{
//BRepAlgoAPI_Fuse aFuse(aWires, aNewEdges);
//BOPAlgo_Builder GenFuse;
//GenFuse.AddArgument(aFace);
GenFuse.AddArgument(aNewEdges);
GenFuse.Perform();
TopoDS_Shape aNewFace = aFace.EmptyCopied();
const TopoDS_Shape& aResFuse = GenFuse.Shape();
//const BOPCol_DataMapOfShapeListOfShape& ModifiedShapes = GenFuse.Images();
const TopTools_DataMapOfShapeListOfShape& ModifiedShapes = GenFuse.Images();
TopTools_IndexedDataMapOfShapeListOfShape VEmapOfNewFace;
TopExp::MapShapesAndAncestors(aResFuse, TopAbs_VERTEX, TopAbs_EDGE, VEmapOfNewFace);
TopoDS_Iterator itw(aFace);
for (; itw.More(); itw.Next())
{
const TopoDS_Shape& aWire = itw.Value();
if (!ModifiedShapes.IsBound(aWire))
continue;
const TopTools_ListOfShape& aListOfModified = ModifiedShapes(aWire);
TopTools_ListIteratorOfListOfShape itwm(aListOfModified);
for (; itwm.More(); itwm.Next())
{
const TopoDS_Wire& aModifiedWire = TopoDS::Wire(itwm.Value());
cout<<"a Modified Wire ..."<<endl;
TopoDS_Wire aNewWire = BuildNewWire(aModifiedWire, VEmapOfNewFace, aNewEdges, aFace);
cout<<"a New Wire ..."<<endl;
BB.Add(aNewFace, aNewWire);
cout<<"a New Face ..."<<endl;
aFacesModifiedFaces.Add(aFace, aNewFace);
//Temporary
BB.Add(aShell, aNewFace);
}
}
}
*/
//Modify the original shape using ReShape
BRepTools_ReShape aReshape;
for (Standard_Integer i = 1; i <= aFacesModifiedFaces.Extent(); i++)
{
const TopoDS_Shape& aFace = aFacesModifiedFaces.FindKey(i);
const TopoDS_Shape& aNewFace = aFacesModifiedFaces(i);
aReshape.Replace(aFace, aNewFace);
}
myShapeResult = aReshape.Apply(myShape);
//Add ChFiFaces
while (!aChFiFaces.IsEmpty())
{
TopTools_ListIteratorOfListOfShape itl(aChFiFaces);
while (itl.More())
{
const TopoDS_Shape& aChFiFace = itl.Value();
TopoDS_Shape aTargetShape = FindProperSubShape(aChFiFace, myShapeResult); //recursive method
if (!aTargetShape.IsNull())
{
aTargetShape.Free(Standard_True);
aTargetShape.Orientation(TopAbs_FORWARD);
BB.Add(aTargetShape, aChFiFace);
aChFiFaces.Remove(itl);
}
else
itl.Next();
}
}
/////////////////////////////////////////
/*
myCoup->Perform(myDS);
//jgv//
TColStd_MapIteratorOfMapOfInteger It(MapIndSo);
for(; It.More(); It.Next()){
Standard_Integer indsol = It.Key();
@@ -431,18 +1205,18 @@ void ChFi3d_Builder::Compute()
for (; exv.More(); exv.Next() ) {
const TopoDS_Vertex& v = TopoDS::Vertex(exv.Current());
Standard_Real tolv = BRep_Tool::Tolerance(v);
if (tole>tolv) B1.UpdateVertex(v,tole);
if (tole>tolv) BB.UpdateVertex(v,tole);
}
}
}
if (!hasresult) {
B1.MakeCompound(TopoDS::Compound(myShapeResult));
BB.MakeCompound(TopoDS::Compound(myShapeResult));
for(It.Reset(); It.More(); It.Next()){
Standard_Integer indsol = It.Key();
const TopoDS_Shape& curshape = DStr.Shape(indsol);
TopTools_ListIteratorOfListOfShape
its = myCoup->Merged(curshape,TopAbs_IN);
if(!its.More()) B1.Add(myShapeResult,curshape);
if(!its.More()) BB.Add(myShapeResult,curshape);
else {
//If the old type of Shape is Shell, Shell is placed instead of Solid,
//However there is a problem for compound of open Shell.
@@ -452,11 +1226,11 @@ void ChFi3d_Builder::Compute()
TopExp_Explorer expsh2(its.Value(),TopAbs_SHELL);
const TopoDS_Shape& cursh = expsh2.Current();
TopoDS_Shape tt = cursh;
B1.Add(myShapeResult,cursh);
BB.Add(myShapeResult,cursh);
its.Next();
}
else {
B1.Add(myShapeResult,its.Value());
BB.Add(myShapeResult,its.Value());
its.Next();
}
}
@@ -465,21 +1239,23 @@ void ChFi3d_Builder::Compute()
}
else {
done=Standard_False;
B1.MakeCompound(TopoDS::Compound(badShape));
BB.MakeCompound(TopoDS::Compound(badShape));
for(It.Reset(); It.More(); It.Next()){
Standard_Integer indsol = It.Key();
const TopoDS_Shape& curshape = DStr.Shape(indsol);
TopTools_ListIteratorOfListOfShape
its = myCoup->Merged(curshape,TopAbs_IN);
if(!its.More()) B1.Add(badShape,curshape);
if(!its.More()) BB.Add(badShape,curshape);
else {
while (its.More()) {
B1.Add(badShape,its.Value());
BB.Add(badShape,its.Value());
its.Next();
}
}
}
}
*/
#ifdef OCCT_DEBUG //perf
ChFi3d_ResultChron(cl_reconstruction ,t_reconstruction);
ChFi3d_InitChron(cl_setregul);
@@ -571,6 +1347,8 @@ void ChFi3d_Builder::Compute()
// if it is necessary
if (IsDone())
{
//Temporary
/*
Standard_Real SameParTol = Precision::Confusion();
Standard_Integer aNbSurfaces, iF;
TopTools_ListIteratorOfListOfShape aIt;
@@ -586,6 +1364,7 @@ void ChFi3d_Builder::Compute()
ShapeFix::SameParameter(aF, Standard_False, SameParTol);
}
}
*/
}
}
@@ -837,11 +1616,14 @@ const TopTools_ListOfShape& ChFi3d_Builder::Generated(const TopoDS_Shape& EouV)
TColStd_ListIteratorOfListOfInteger IL;
for(IL.Initialize(L); IL.More(); IL.Next()){
Standard_Integer I = IL.Value();
const TopTools_ListOfShape& LS = myCoup->NewFaces(I);
//const TopTools_ListOfShape& LS = myCoup->NewFaces(I);
const TopoDS_Face& aNewFace = TopoDS::Face(myNewFaces(I));
/*
TopTools_ListIteratorOfListOfShape ILS;
for(ILS.Initialize(LS); ILS.More(); ILS.Next()){
for(ILS.Initialize(LS); ILS.More(); ILS.Next())
myGenerated.Append(ILS.Value());
}
*/
myGenerated.Append(aNewFace);
}
}
return myGenerated;

View File

@@ -31,11 +31,14 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfInteger.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <ChFiDS_ErrorStatus.hxx>
#include <math_Vector.hxx>
#include <TopAbs_Orientation.hxx>
//#include <BRepOffset_Type.hxx>
#include <ChFiDS_SequenceOfSurfData.hxx>
#include <TopAbs_State.hxx>
@@ -74,6 +77,22 @@ class TopoDS_Face;
class AppBlend_Approx;
class Geom2d_Curve;
struct QualifiedEdge
{
Standard_Integer Index;
TopAbs_Orientation Orientation;
//BRepOffset_Type Convexity;
QualifiedEdge(Standard_Integer theIndex,
TopAbs_Orientation theOrientation)
: Index(theIndex),
Orientation(theOrientation)
{
}
};
typedef NCollection_List<QualifiedEdge> ChFi3d_ListOfQualifiedEdge;
typedef ChFi3d_ListOfQualifiedEdge::Iterator ChFi3d_ListIteratorOfListOfQualifiedEdge;
//! Root class for calculation of surfaces (fillets,
//! chamfers) destined to smooth edges of
@@ -719,6 +738,7 @@ protected:
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation Or1,
const Standard_Integer theIndOfFace2,
const Standard_Boolean Gd1,
const Standard_Boolean Gd2,
const Standard_Boolean Gf1,
@@ -746,6 +766,7 @@ protected:
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation Or1,
const Standard_Integer theIndOfFace2,
const Standard_Boolean Gd1,
const Standard_Boolean Gd2,
const Standard_Boolean Gf1,
@@ -779,6 +800,12 @@ protected:
ChFiDS_Map myVFMap;
ChFiDS_Map myVEMap;
Handle(TopOpeBRepDS_HDataStructure) myDS;
//TopTools_IndexedDataMapOfShapeListOfShape myFaceNewEdges;
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger> myFaceNewEdges;
//NCollection_IndexedDataMap<Standard_Integer, ChFi3d_ListOfQualifiedEdge> myFaceNewEdges;
TopTools_IndexedMapOfShape myNewFaces;
TopTools_IndexedMapOfShape myNewEdges;
TColStd_MapOfInteger myIndsChFiFaces;
Handle(TopOpeBRepBuild_HBuilder) myCoup;
ChFiDS_ListOfStripe myListStripe;
ChFiDS_StripeMap myVDataMap;

View File

@@ -90,6 +90,7 @@
#include <BRepTools.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepLib_MakeFace.hxx>
@@ -176,6 +177,66 @@ extern void ChFi3d_SettraceDRAWSPINE(const Standard_Boolean b);
#include <BRepAdaptor_HSurface.hxx>
#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
//=======================================================================
//function : ChFi3d_IsFirstInside
//purpose :
//=======================================================================
Standard_Boolean ChFi3d_IsFirstInside(const Standard_Real theVal1,
const Standard_Real theVal2,
const Standard_Real theMin,
const Standard_Real theMax)
{
Standard_Real IsFirstInside = (theMin < theVal1 && theVal1 < theMax);
Standard_Real IsSecondInside = (theMin < theVal2 && theVal2 < theMax);
if (IsFirstInside && !IsSecondInside)
return Standard_True;
if (!IsFirstInside && IsSecondInside)
return Standard_False;
if (IsFirstInside && IsSecondInside)
{
Standard_Real MinDistForFirst = Min(theVal1 - theMin, theMax - theVal1);
Standard_Real MinDistForSecond = Min(theVal2 - theMin, theMax - theVal2);
return (MinDistForFirst > MinDistForSecond);
}
else
{
#ifdef OCCT_DEBUG
std::cout << std::endl << "Both points outside!" << std::endl;
#endif
return Standard_True;
}
}
//=======================================================================
//function : ChFi3d_AdjustPCurve
//purpose :
//=======================================================================
void ChFi3d_AdjustPCurve(Geom2dAdaptor_Curve& thePCurve,
const Standard_Real theCoordOnPCurve,
const Standard_Real theRefCoord,
const Standard_Real thePeriod,
const Standard_Boolean theInUdirection)
{
Standard_Real aCoord = theCoordOnPCurve;
Standard_Real Sign = (aCoord < theRefCoord)? 1 : -1;
while (Abs(aCoord - theRefCoord) > thePeriod/2)
aCoord += Sign * thePeriod;
Standard_Real Offset = aCoord - theCoordOnPCurve;
gp_Vec2d OffsetVector;
if (theInUdirection)
OffsetVector.SetCoord(Offset, 0.);
else
OffsetVector.SetCoord(0., Offset);
Handle(Geom2d_Curve) aPCurve = thePCurve.Curve();
aPCurve->Translate(OffsetVector);
thePCurve.Load(aPCurve);
}
//=======================================================================
//function : ChFi3d_InPeriod
//purpose :
@@ -192,6 +253,211 @@ Standard_Real ChFi3d_InPeriod(const Standard_Real U,
if ( u < UFirst) u = UFirst;
return u;
}
//=======================================================================
//function : ChFi3d_AdjustSecondPointToFirstPoint
//purpose :
//=======================================================================
void ChFi3d_AdjustSecondPointToFirstPoint(const gp_Pnt2d& theFirstPoint,
gp_Pnt2d& theSecondPoint,
const BRepAdaptor_Surface& theSurf)
{
if (theSurf.IsUPeriodic())
{
Standard_Real UPeriod = theSurf.UPeriod();
Standard_Real NewU = ElCLib::InPeriod(theSecondPoint.X(),
theFirstPoint.X() - UPeriod/2,
theFirstPoint.X() + UPeriod/2);
theSecondPoint.SetX(NewU);
}
if (theSurf.IsVPeriodic())
{
Standard_Real VPeriod = theSurf.VPeriod();
Standard_Real NewV = ElCLib::InPeriod(theSecondPoint.Y(),
theFirstPoint.Y() - VPeriod/2,
theFirstPoint.Y() + VPeriod/2);
theSecondPoint.SetY(NewV);
}
}
//=======================================================================
//function : ChFi3d_SplitAndAdjust
//purpose :
//=======================================================================
void ChFi3d_SplitAndAdjust(const TopTools_ListOfShape& theElist,
TopTools_ListOfShape& theNewElist,
const BRepAdaptor_Surface& theBAsurf)
{
TopoDS_Face aFace = theBAsurf.Face();
Handle(Geom_Surface) aSurf, aBasisSurf;
TopLoc_Location aLoc;
aSurf = BRep_Tool::Surface(aFace, aLoc);
aBasisSurf = aSurf;
if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
aBasisSurf = (Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf))->BasisSurface();
if (!aBasisSurf->IsUClosed() && !aBasisSurf->IsVClosed())
return;
TColGeom2d_SequenceOfCurve Boundaries;
Standard_Real Ubounds [2], Vbounds [2];
aSurf->Bounds(Ubounds[0], Ubounds[1], Vbounds[0], Vbounds[1]);
for (Standard_Integer i = 0; i < 2; i++)
if (!Precision::IsInfinite(Ubounds[i]))
{
gp_Pnt2d Origin(Ubounds[i], 0.);
Handle(Geom2d_Curve) aLine = new Geom2d_Line(Origin, gp::DY2d());
if (!Precision::IsInfinite(Vbounds[0]) || !Precision::IsInfinite(Vbounds[1]))
aLine = new Geom2d_TrimmedCurve(aLine, Vbounds[0], Vbounds[1]);
Boundaries.Append(aLine);
}
for (Standard_Integer i = 0; i < 2; i++)
if (!Precision::IsInfinite(Vbounds[i]))
{
gp_Pnt2d Origin(0., Vbounds[i]);
Handle(Geom2d_Curve) aLine = new Geom2d_Line(Origin, gp::DX2d());
if (!Precision::IsInfinite(Ubounds[0]) || !Precision::IsInfinite(Ubounds[1]))
aLine = new Geom2d_TrimmedCurve(aLine, Ubounds[0], Ubounds[1]);
Boundaries.Append(aLine);
}
Geom2dInt_GInter Intersector;
BRep_Builder BB;
TopTools_ListIteratorOfListOfShape itl(theElist);
for (; itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
TopAbs_Orientation anOr = anEdge.Orientation();
Standard_Real aTol = BRep_Tool::Tolerance(anEdge);
TColStd_SequenceOfReal Params;
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, fpar, lpar);
Geom2dAdaptor_Curve aGAcurve(aPCurve, fpar, lpar);
Standard_Real LeftTol = Precision::PConfusion(), RightTol = Precision::PConfusion();
BRepAdaptor_Curve BAcurve(anEdge);
gp_Pnt FirstPnt = BAcurve.Value(fpar);
gp_Pnt LastPnt = BAcurve.Value(lpar);
Standard_Real Offset = 0.01*(lpar - fpar);
gp_Pnt PntOffset = BAcurve.Value(fpar + Offset);
Standard_Real dist3d = FirstPnt.Distance(PntOffset);
if (dist3d > gp::Resolution())
LeftTol = Offset*aTol/dist3d;
PntOffset = BAcurve.Value(lpar - Offset);
dist3d = LastPnt.Distance(PntOffset);
if (dist3d > gp::Resolution())
RightTol = Offset*aTol/dist3d;
for (Standard_Integer i = 1; i <= Boundaries.Length(); i++)
{
Geom2dAdaptor_Curve aGAboundary(Boundaries(i));
Intersector.Perform(aGAcurve, aGAboundary,
Precision::PIntersection(),
Precision::PIntersection());
if (Intersector.IsDone() && !Intersector.IsEmpty())
{
for (Standard_Integer j = 1; j <= Intersector.NbPoints(); j++)
{
IntRes2d_IntersectionPoint int2d = Intersector.Point(j);
Standard_Real aParam = int2d.ParamOnFirst();
if (Abs(aParam - fpar) > LeftTol &&
Abs(aParam - lpar) > RightTol)
Params.Append(aParam);
}
for (Standard_Integer j = 1; j <= Intersector.NbSegments(); j++)
{
IntRes2d_IntersectionSegment seg2d = Intersector.Segment(j);
IntRes2d_IntersectionPoint int2d = seg2d.FirstPoint();
Standard_Real aParam = int2d.ParamOnFirst();
if (Abs(aParam - fpar) > LeftTol &&
Abs(aParam - lpar) > RightTol)
Params.Append(aParam);
int2d = seg2d.LastPoint();
aParam = int2d.ParamOnFirst();
if (Abs(aParam - fpar) > LeftTol &&
Abs(aParam - lpar) > RightTol)
Params.Append(aParam);
}
}
} //for (Standard_Integer i = 1; i <= Boundaries.Length(); i++)
//Sort parameters
for (Standard_Integer i = 1; i < Params.Length(); i++)
for (Standard_Integer j = i+1; j <= Params.Length(); j++)
if (Params(i) > Params(j))
{ Standard_Real tmp = Params(i); Params(i) = Params(j); Params(j) = tmp; }
//Delete duplicating parameters
Standard_Real ParamTol = Max(LeftTol, RightTol);
Standard_Integer i = 2;
while (i <= Params.Length())
if (Params(i) - Params(i-1) > ParamTol)
Params.Remove(i);
else
i++;
//Split
TopoDS_Vertex FirstVertex = TopExp::FirstVertex(anEdge), LastVertex;
Standard_Real FirstPar = fpar, LastPar;
for (i = 1; i <= Params.Length(); i++)
{
LastPar = Params(i);
TopoDS_Edge aNewEdge = TopoDS::Edge(anEdge.EmptyCopied());
aNewEdge.Orientation(TopAbs_FORWARD);
BB.Range(aNewEdge, FirstPar, LastPar);
gp_Pnt aLastPnt = BAcurve.Value(LastPar);
LastVertex = BRepLib_MakeVertex(aLastPnt);
BB.UpdateVertex(LastVertex, ParamTol);
BB.Add(aNewEdge, FirstVertex.Oriented(TopAbs_FORWARD));
BB.Add(aNewEdge, LastVertex.Oriented(TopAbs_REVERSED));
aNewEdge.Orientation(anOr);
BB.UpdateEdge(aNewEdge, aTol);
theNewElist.Append(aNewEdge);
FirstVertex = LastVertex;
FirstPar = LastPar;
}
LastPar = lpar;
LastVertex = TopExp::LastVertex(anEdge);
TopoDS_Edge aNewEdge = TopoDS::Edge(anEdge.EmptyCopied());
aNewEdge.Orientation(TopAbs_FORWARD);
BB.Range(aNewEdge, FirstPar, LastPar);
BB.Add(aNewEdge, FirstVertex.Oriented(TopAbs_FORWARD));
BB.Add(aNewEdge, LastVertex.Oriented(TopAbs_REVERSED));
aNewEdge.Orientation(anOr);
BB.UpdateEdge(aNewEdge, aTol);
theNewElist.Append(aNewEdge);
}
if (theNewElist.IsEmpty())
theNewElist.Assign(theElist);
//Adjust
for (itl.Initialize(theNewElist); itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, fpar, lpar);
gp_Pnt2d MidP2d = aPCurve->Value(0.5*(fpar + lpar));
Standard_Real aU = MidP2d.X(), aV = MidP2d.Y();
if (aU < Ubounds[0] || aU > Ubounds[1])
{
Standard_Real Period = Ubounds[1] - Ubounds[0];
Standard_Real Sign = (aU < Ubounds[0])? 1 : -1;
while (aU < Ubounds[0] || aU > Ubounds[1])
aU += Sign*Period;
}
if (aV < Vbounds[0] || aV > Vbounds[1]) //??? sphere? cone?
{
Standard_Real Period = Vbounds[1] - Vbounds[0];
Standard_Real Sign = (aV < Vbounds[0])? 1 : -1;
while (aV < Vbounds[0] || aV > Vbounds[1])
aV += Sign*Period;
}
if (aU != MidP2d.X() || aV != MidP2d.Y())
{
gp_Vec2d OffsetVec(aU - MidP2d.X(), aV - MidP2d.Y());
aPCurve->Translate(OffsetVec);
}
}
}
//=======================================================================
//function : Box
//purpose : Calculation of min/max uv of the fillet to intersect.
@@ -832,7 +1098,9 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
gp_Pnt2d P2d;
if (Check2dDistance)
P2d = BRep_Tool::Parameters( Vtx, face );
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,fd2,pref2,p2,jf2,sens2,P2d,Check2dDistance,enlarge)) {
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,
fd2,pref2,p2,jf2,sens2,
face,P2d,Check2dDistance,enlarge)) {
u1 = p1; u2 = p2; ss = sameside; j1 = jf1; j2 = jf2; ff = face;
ok = 1;
}
@@ -853,7 +1121,9 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
gp_Pnt2d P2d;
if (Check2dDistance)
P2d = BRep_Tool::Parameters( Vtx, face );
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,fd2,pref2,p2,jf2,sens2,P2d,Check2dDistance,enlarge)) {
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,
fd2,pref2,p2,jf2,sens2,
face,P2d,Check2dDistance,enlarge)) {
Standard_Boolean restore =
ok && ((j1 == jf1 && sens1*(p1 - u1) > 0.) ||
(j2 == jf2 && sens2*(p2 - u2) > 0.));
@@ -886,7 +1156,9 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
gp_Pnt2d P2d;
if (Check2dDistance)
P2d = BRep_Tool::Parameters( Vtx, face );
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,fd2,pref2,p2,jf2,sens2,P2d,Check2dDistance,enlarge)) {
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,
fd2,pref2,p2,jf2,sens2,
face,P2d,Check2dDistance,enlarge)) {
Standard_Boolean restore =
ok && ((j1 == jf1 && sens1*(p1 - u1) > 0.) ||
(j2 == jf2 && sens2*(p2 - u2) > 0.));
@@ -919,7 +1191,9 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
gp_Pnt2d P2d;
if (Check2dDistance)
P2d = BRep_Tool::Parameters( Vtx, face );
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,fd2,pref2,p2,jf2,sens2,P2d,Check2dDistance,enlarge)) {
if(ChFi3d_IntTraces(fd1,pref1,p1,jf1,sens1,
fd2,pref2,p2,jf2,sens2,
face,P2d,Check2dDistance,enlarge)) {
Standard_Boolean restore =
ok && ((j1 == jf1 && sens1*(p1 - u1) > 0.) ||
(j2 == jf2 && sens2*(p2 - u2) > 0.));
@@ -956,18 +1230,19 @@ static Standard_Real recadre(const Standard_Real p,
//purpose :
//=======================================================================
Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
const Standard_Real pref1,
Standard_Real& p1,
const Standard_Integer jf1,
const Standard_Integer sens1,
const Handle(ChFiDS_SurfData)& fd2,
const Standard_Real pref2,
Standard_Real& p2,
const Standard_Integer jf2,
const Standard_Integer sens2,
const gp_Pnt2d& RefP2d,
const Standard_Boolean Check2dDistance,
const Standard_Boolean enlarge)
const Standard_Real pref1,
Standard_Real& p1,
const Standard_Integer jf1,
const Standard_Integer sens1,
const Handle(ChFiDS_SurfData)& fd2,
const Standard_Real pref2,
Standard_Real& p2,
const Standard_Integer jf2,
const Standard_Integer sens2,
const TopoDS_Face& theFace,
const gp_Pnt2d& RefP2d,
const Standard_Boolean Check2dDistance,
const Standard_Boolean enlarge)
{
Geom2dAdaptor_Curve C1;
Geom2dAdaptor_Curve C2;
@@ -1021,6 +1296,26 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
Intersection.Perform(C1,C2,
Precision::PIntersection(),
Precision::PIntersection());
if (!Intersection.IsDone() || Intersection.IsEmpty())
{
BRepAdaptor_Surface BAsurf(theFace, Standard_False);
if (BAsurf.IsUPeriodic())
{
//put the pcurves in the same parametric context
Standard_Real Uperiod = BAsurf.UPeriod();
Standard_Real Umin = BAsurf.FirstUParameter();
Standard_Real Umax = BAsurf.LastUParameter();
gp_Pnt2d Origin1 = C1.Value(0.);
gp_Pnt2d Origin2 = C2.Value(0.);
Standard_Boolean IsFirstPointInside =
ChFi3d_IsFirstInside(Origin1.X(), Origin2.X(), Umin, Umax);
if (IsFirstPointInside)
ChFi3d_AdjustPCurve(C2, Origin2.X(), Origin1.X(), Uperiod, Standard_True);
else
ChFi3d_AdjustPCurve(C1, Origin1.X(), Origin2.X(), Uperiod, Standard_True);
}
}
}
if (Intersection.IsDone()) {
if (!Intersection.IsEmpty()) {
@@ -4674,6 +4969,24 @@ Standard_Integer ChFi3d_NumberOfSharpEdges(const TopoDS_Vertex& Vtx,
return nba;
}
//=======================================================================
//function : IsInSingularity
//purpose :
//
//=======================================================================
Standard_Boolean ChFi3d_IsInSingularity(const TopoDS_Vertex& Vtx,
const ChFiDS_Map& VEMap)
{
TopTools_ListIteratorOfListOfShape ItE;
for (ItE.Initialize(VEMap(Vtx)); ItE.More(); ItE.Next())
{
const TopoDS_Edge& cur = TopoDS::Edge(ItE.Value());
if (BRep_Tool::Degenerated(cur))
return Standard_True;
}
return Standard_False;
}
//=====================================================
// function cherche_vertex
// finds common vertex between two edges

View File

@@ -81,6 +81,14 @@ Standard_Real ChFi3d_InPeriod(const Standard_Real U,
const Standard_Real ULast,
const Standard_Real Eps);
void ChFi3d_AdjustSecondPointToFirstPoint(const gp_Pnt2d& theFirstPoint,
gp_Pnt2d& theSecondPoint,
const BRepAdaptor_Surface& theSurf);
void ChFi3d_SplitAndAdjust(const TopTools_ListOfShape& theElist,
TopTools_ListOfShape& theNewElist,
const BRepAdaptor_Surface& theBAsurf);
void ChFi3d_Boite(const gp_Pnt2d& p1,const gp_Pnt2d& p2,
Standard_Real& mu,Standard_Real& Mu,
Standard_Real& mv,Standard_Real& Mv);
@@ -327,6 +335,7 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
Standard_Real& p2,
const Standard_Integer jf2,
const Standard_Integer sens2,
const TopoDS_Face& theFace,
const gp_Pnt2d& RefP2d,
const Standard_Boolean Check2dDistance = Standard_False,
const Standard_Boolean enlarge = Standard_False);
@@ -561,6 +570,9 @@ Standard_Integer ChFi3d_NumberOfSharpEdges(const TopoDS_Vertex& Vtx,
const ChFiDS_Map& VEMap,
const ChFiDS_Map& EFmap);
Standard_Boolean ChFi3d_IsInSingularity(const TopoDS_Vertex& Vtx,
const ChFiDS_Map& VEMap);
void ChFi3d_cherche_vertex (const TopoDS_Edge & E1,
const TopoDS_Edge & E2,
TopoDS_Vertex & vertex,

View File

@@ -2419,7 +2419,8 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe,
Handle(ChFiDS_SurfData) SD = new ChFiDS_SurfData();
ChFiDS_SequenceOfSurfData LSD;
if(!ChFiKPart_ComputeData::Compute(DStr,SD,HS1,HS2,Or1,Or2,Spine,iedge)){
if(!ChFiKPart_ComputeData::Compute(DStr,myNewFaces,myNewEdges,myFaceNewEdges,myIndsChFiFaces,
SD,HS1,HS2,Or1,Or2,Spine,iedge)){
#ifdef OCCT_DEBUG
std::cout<<"failed calculation KPart"<<std::endl;
#endif
@@ -2728,9 +2729,10 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
// Modified by Sergey KHROMOV - Wed Feb 5 12:03:17 2003 Begin
// if(ChFi3d_IntTraces(prevsd,prevpar1,nprevpar1,1,1,
// nextsd,nextpar1,nnextpar1,1,-1,p2d)){
TopoDS_Face FaceOfPCurves = TopoDS::Face(DStr.Shape(prevsd->Index(1)));
if(ChFi3d_IntTraces(prevsd,prevpar1,nprevpar1,1,1,
nextsd,nextpar1,nnextpar1,1,-1,p2d,
Standard_False, Standard_True)){
nextsd,nextpar1,nnextpar1,1,-1,
FaceOfPCurves,p2d,Standard_False, Standard_True)){
// Modified by Sergey KHROMOV - Wed Feb 5 12:03:17 2003 End
previntf1.SetLastParameter(nprevpar1);
nextintf1.SetFirstParameter(nnextpar1);
@@ -2786,9 +2788,10 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
// Modified by Sergey KHROMOV - Wed Feb 5 12:03:17 2003 Begin
// if(ChFi3d_IntTraces(prevsd,prevpar2,nprevpar2,2,1,
// nextsd,nextpar2,nnextpar2,2,-1,p2d)){
TopoDS_Face FaceOfPCurves = TopoDS::Face(DStr.Shape(prevsd->Index(2)));
if(ChFi3d_IntTraces(prevsd,prevpar2,nprevpar2,2,1,
nextsd,nextpar2,nnextpar2,2,-1,p2d,
Standard_False, Standard_True)){
nextsd,nextpar2,nnextpar2,2,-1,
FaceOfPCurves,p2d,Standard_False, Standard_True)){
// Modified by Sergey KHROMOV - Wed Feb 5 12:03:17 2003 End
previntf2.SetLastParameter(nprevpar2);
nextintf2.SetFirstParameter(nnextpar2);
@@ -2985,7 +2988,8 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
TColStd_ListOfInteger li;
myEVIMap.Bind(Ej,li);
}
myEVIMap.ChangeFind(Ej).Append(cursd->Surf());
//myEVIMap.ChangeFind(Ej).Append(cursd->Surf());
myEVIMap.ChangeFind(Ej).Append(cursd->IndexOfFace());
}
}
else if(IF < IL){

View File

@@ -98,6 +98,7 @@
#include <TopOpeBRepDS_Surface.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <stdio.h>
@@ -533,6 +534,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation Or1,
const Standard_Integer theIndOfFace2,
const Standard_Boolean Gd1,
const Standard_Boolean Gd2,
const Standard_Boolean Gf1,
@@ -558,7 +560,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
#ifdef OCCT_DEBUG
approx.Dump(std::cout);
#endif
return StoreData( Data, approx, lin, S1, S2, Or1, Gd1, Gd2, Gf1, Gf2, Reversed);
return StoreData( Data, approx, lin, S1, S2, Or1, theIndOfFace2, Gd1, Gd2, Gf1, Gf2, Reversed);
}
@@ -595,7 +597,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
approx.Dump(std::cout);
#endif
return StoreData(Data,approx,lin,S1,S2,Or,0,0,0,0,Reversed);
return StoreData(Data,approx,lin,S1,S2,Or,0,0,0,0,0,Reversed); //jgv 0???
}
@@ -632,7 +634,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
approx.Dump(std::cout);
#endif
return StoreData(Data,approx,lin,S1,S2,Or,0,0,0,0);
return StoreData(Data,approx,lin,S1,S2,Or,0,0,0,0,0); //jgv 0???
}
@@ -649,6 +651,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation Or1,
const Standard_Integer theIndOfFace2,
const Standard_Boolean Gd1,
const Standard_Boolean Gd2,
const Standard_Boolean Gf1,
@@ -755,6 +758,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
BS1 = Handle(BRepAdaptor_HSurface)::DownCast(S1);
Handle(BRepAdaptor_HSurface)
BS2 = Handle(BRepAdaptor_HSurface)::DownCast(S2);
TopoDS_Face FaceOfS2;
Geom2dAPI_ProjectPointOnCurve projector;
Standard_Real Uon1 = UFirst, Uon2 = ULast;
@@ -817,6 +821,28 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
if(Reversed) TraOn1 = ChFi3d_TrsfTrans(lin->TransitionOnS2());
else TraOn1 = ChFi3d_TrsfTrans(lin->TransitionOnS1());
Fint1.SetInterference(Index1OfCurve,TraOn1,PCurveOnFace,PCurveOnSurf);
//jgv
TopoDS_Edge Boundary1, Boundary2;
Boundary1 = BRepLib_MakeEdge(Crv3d1, pppdeb, pppfin);
BRep_Builder BB;
BB.UpdateEdge(Boundary1, tolcheck);
TopLoc_Location aLoc;
BB.UpdateEdge(Boundary1, PCurveOnSurf, Surf, aLoc, 0.);
BB.UpdateEdge(Boundary1, PCurveOnFace, BS1->ChangeSurface().Face(), 0.);
myNewEdges.Add(Boundary1);
Standard_Integer IndF1, IndF2;
if (!myNewFaces.Contains(BS1->ChangeSurface().Face()))
myNewFaces.Add(BS1->ChangeSurface().Face());
IndF1 = myNewFaces.FindIndex(BS1->ChangeSurface().Face());
if (!myFaceNewEdges.Contains(IndF1))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndF1, aList);
}
/////
// SurfData is filled in what concerns S2,
Handle(Geom_Curve) Crv3d2 = Surf->UIso(Uon2);
@@ -870,6 +896,29 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
if(Reversed) TraOn2 = ChFi3d_TrsfTrans(lin->TransitionOnS1());
else TraOn2 = ChFi3d_TrsfTrans(lin->TransitionOnS2());
Fint2.SetInterference(Index2OfCurve,TraOn2,PCurveOnFace,PCurveOnSurf);
//jgv
Boundary2 = BRepLib_MakeEdge(Crv3d2, pppdeb, pppfin);
BB.UpdateEdge(Boundary2, tolcheck);
BB.UpdateEdge(Boundary2, PCurveOnSurf, Surf, aLoc, 0.);
if (BS2.IsNull())
FaceOfS2 = TopoDS::Face(myNewFaces(theIndOfFace2));
else
FaceOfS2 = BS2->ChangeSurface().Face();
//BB.UpdateEdge(Boundary2, PCurveOnFace, BS2->ChangeSurface().Face(), 0.);
BB.UpdateEdge(Boundary2, PCurveOnFace, FaceOfS2, 0.);
myNewEdges.Add(Boundary2);
if (!myNewFaces.Contains(FaceOfS2))
myNewFaces.Add(FaceOfS2);
IndF2 = myNewFaces.FindIndex(FaceOfS2);
if (!myFaceNewEdges.Contains(IndF2))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndF2, aList);
}
/////
}
else {
Handle(Geom2d_Curve) bidpc;
@@ -932,6 +981,36 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
break;
}
// Modified by skv - Wed Jun 9 17:16:26 2004 OCC5898 End
//Add new face and its new edges in the maps
TopoDS_Face aNewFace;
BB.MakeFace(aNewFace);
BB.UpdateFace(aNewFace, Surf, aLoc, Precision::Confusion());
aNewFace.Orientation(Data->Orientation());
Standard_Integer IndNewFace = myNewFaces.Add(aNewFace);
myIndsChFiFaces.Add(IndNewFace);
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndNewFace, aList);
Data->ChangeIndexOfFace(IndNewFace);
Standard_Integer IndE1 = myNewEdges.FindIndex(Boundary1);
Data->ChangeIndexOfE1(IndE1);
IndE1 *= -1;
myFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE1);
IndE1 *= -1;
if (Data->Orientation() != BS1->ChangeSurface().Face().Orientation())
IndE1 *= -1;
myFaceNewEdges.ChangeFromKey(IndF1).Append(IndE1);
Standard_Integer IndE2 = myNewEdges.FindIndex(Boundary2);
Data->ChangeIndexOfE2(IndE2);
myFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE2);
IndE2 *= -1;
if (Data->Orientation() != FaceOfS2.Orientation())
IndE2 *= -1;
myFaceNewEdges.ChangeFromKey(IndF2).Append(IndE2);
////////////////////////
if(!Gd1 && !S1.IsNull())
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),

View File

@@ -42,6 +42,7 @@
#include <BRepBlend_Line.hxx>
#include <BRepExtrema_ExtCC.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepTools.hxx>
#include <BRepTopAdaptor_TopolTool.hxx>
#include <ChFi3d.hxx>
@@ -140,6 +141,7 @@
#include <TopOpeBRepDS_Transition.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//#include <BOPTools_AlgoTools2D.hxx>
#ifdef OCCT_DEBUG
# ifdef DRAW
@@ -598,6 +600,9 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
}
Handle(ChFiDS_SurfData)& Fd = SeqFil.ChangeValue(num);
//jgv
Standard_Integer IndexOfNewFace = Fd->IndexOfFace();
/////
ChFiDS_CommonPoint& CV1 = Fd->ChangeVertex(isfirst,1);
ChFiDS_CommonPoint& CV2 = Fd->ChangeVertex(isfirst,2);
//To evaluate the new points.
@@ -621,6 +626,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
BRepAdaptor_Surface& Bs = HBs->ChangeSurface();
BRepAdaptor_Surface& Bad = HBad->ChangeSurface();
BRepAdaptor_Surface& Bop = HBop->ChangeSurface();
TopoDS_Edge aNewEdge;
Handle(Geom_Curve) Cc;
Handle(Geom2d_Curve) Pc,Ps;
Standard_Real Ubid,Vbid;//,mu,Mu,mv,Mv;
@@ -631,6 +637,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Standard_Integer IFadArc = 1, IFopArc = 2;
Fop = TopoDS::Face(DStr.Shape(Fd->Index(IFopArc)));
TopExp_Explorer ex;
BRep_Builder BB;
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf condition if (onsame)
@@ -731,12 +738,11 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
TopoDS_Face FFv;
Standard_Real tol;
Standard_Integer prol=0;
BRep_Builder BRE;
Handle(Geom_Surface ) Sface;
Sface=BRep_Tool::Surface(Fv);
ChFi3d_ExtendSurface(Sface,prol);
tol=BRep_Tool::Tolerance(Fv);
BRE.MakeFace(FFv,Sface,tol);
BB.MakeFace(FFv,Sface,tol);
if (prol) {
Bs.Initialize(FFv,Standard_False);
DStr.SetNewSurface(Fv,Sface);
@@ -753,6 +759,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
ChFiDS_FaceInterference& FiopArc = Fd->ChangeInterference(IFopArc);
ChFiDS_CommonPoint& CPadArc = Fd->ChangeVertex(isfirst,IFadArc);
ChFiDS_FaceInterference& FiadArc = Fd->ChangeInterference(IFadArc);
TopoDS_Vertex VerFopFad [3];
//the parameter of the vertex in the air is initialiced with the value of
//its opposite (point on arc).
Standard_Real wop = Fd->ChangeInterference(IFadArc).Parameter(isfirst);
@@ -768,6 +775,26 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
inters = IntersUpdateOnSame (HGs,HBs,c3df,Fop,Fv,Arcprol,Vtx,isfirst,10*tolesp, // in
FiopArc,CPopArc,p2dbout,wop); // out
//jgv
for (Standard_Integer is = 1; is <= 2; is++)
{
ChFiDS_FaceInterference& Interf = Fd->ChangeInterference(is);
Standard_Integer IndEsurf = Fd->IndexOfEdge(is);
TopoDS_Edge EdgeSurf = TopoDS::Edge(myNewEdges(IndEsurf));
Standard_Real fpar, lpar;
Handle(Geom_Curve) CurveEdgeSurf = BRep_Tool::Curve(EdgeSurf, fpar, lpar);
//BRep_Tool::Range(EdgeSurf, fpar, lpar);
if (isfirst)
fpar = Interf.FirstParameter();
else
lpar = Interf.LastParameter();
BB.Range(EdgeSurf, fpar, lpar);
VerFopFad[is] = (isfirst)? TopExp::FirstVertex(EdgeSurf)
: TopExp::LastVertex(EdgeSurf);
gp_Pnt aPnt = CurveEdgeSurf->Value((isfirst)? fpar : lpar);
BB.UpdateVertex(VerFopFad[is], aPnt, 0.);
}
/////
Handle(BRepAdaptor_HCurve2d) pced = new BRepAdaptor_HCurve2d();
pced->ChangeCurve2d().Initialize(CPadArc.Arc(),Fv);
@@ -794,6 +821,35 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Update(HBs,pced,HGs,Fd->ChangeInterferenceOnS1(),CV1,isfirst);
pced->ChangeCurve2d().Initialize(CV2.Arc(),Fv);
Update(HBs,pced,HGs,Fd->ChangeInterferenceOnS2(),CV2,isfirst);
//jgv
for (Standard_Integer is = 1; is <= 2; is++)
{
const ChFiDS_FaceInterference& Interf = Fd->Interference(is);
Standard_Integer IndEsurf = Fd->IndexOfEdge(is);
TopoDS_Edge EdgeSurf = TopoDS::Edge(myNewEdges(IndEsurf));
EdgeSurf.Orientation(TopAbs_FORWARD);
Standard_Real fpar, lpar;
Handle(Geom_Curve) CurveEdgeSurf = BRep_Tool::Curve(EdgeSurf, fpar, lpar);
if (isfirst)
fpar = Interf.FirstParameter();
else
lpar = Interf.LastParameter();
BB.Range(EdgeSurf, fpar, lpar);
VerFopFad[is] = (isfirst)? TopExp::FirstVertex(EdgeSurf)
: TopExp::LastVertex(EdgeSurf);
gp_Pnt aPnt = CurveEdgeSurf->Value((isfirst)? fpar : lpar);
if (VerFopFad[is].IsNull())
{
VerFopFad[is] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirst)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeSurf, VerFopFad[is].Oriented(OrOfVer));
}
else
BB.UpdateVertex(VerFopFad[is], aPnt, 0.);
}
/////
}
@@ -829,6 +885,26 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Hc2 = BRep_Tool::CurveOnSurface(CV2.Arc(),Fv,Ubid,Ubid);
pfac2 = Hc2->Value(CV2.ParameterOnArc());
}
//jgv
if (Bs.IsUPeriodic() || Bs.IsVPeriodic())
{
gp_Pnt Pnt1 = BRep_Tool::Pnt(VerFopFad[1]);
gp_Pnt Pnt2 = BRep_Tool::Pnt(VerFopFad[2]);
gp_Pnt MidPnt((Pnt1.XYZ() + Pnt2.XYZ())/2);
//Project middle point onto surface
Extrema_ExtPS ProjPS(MidPnt, Bs,
Precision::PConfusion(), Precision::PConfusion());
Standard_Integer indmin = 1;
for (Standard_Integer iext = 2; iext <= ProjPS.NbExt(); iext++)
if (ProjPS.SquareDistance(iext) < ProjPS.SquareDistance(indmin))
indmin = iext;
Standard_Real uu, vv;
ProjPS.Point(indmin).Parameter(uu,vv);
gp_Pnt2d MidPnt2d(uu, vv);
ChFi3d_AdjustSecondPointToFirstPoint(MidPnt2d, pfac1, Bs);
ChFi3d_AdjustSecondPointToFirstPoint(MidPnt2d, pfac2, Bs);
}
/////
if (Fi1.LineIndex() != 0) {
pfil1 = Fi1.PCurveOnSurf()->Value(Fi1.Parameter(isfirst));
}
@@ -857,6 +933,43 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Pc,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
//jgv
/*
gp_Pnt Pver, Pcur;
Pver = BRep_Tool::Pnt(VerFopFad[IFopArc]);
Pcur = Cc->Value(Cc->FirstParameter());
Standard_Real aDist = Pver.Distance(Pcur);
BB.UpdateVertex(VerFopFad[IFopArc], 1.01*aDist);
Pver = BRep_Tool::Pnt(VerFopFad[IFadArc]);
Pcur = Cc->Value(Cc->LastParameter());
aDist = Pver.Distance(Pcur);
BB.UpdateVertex(VerFopFad[IFadArc], 1.01*aDist);
*/
Standard_Integer ind_first, ind_last;
if (onsame)
{
ind_first = IFopArc; ind_last = IFadArc;
}
else
{
ind_first = IFadArc; ind_last = IFopArc;
}
aNewEdge = BRepLib_MakeEdge(Cc,
VerFopFad[ind_first], VerFopFad[ind_last],
Cc->FirstParameter(), Cc->LastParameter());
BB.UpdateEdge(aNewEdge, tolreached);
TopLoc_Location aLoc;
BB.UpdateEdge(aNewEdge, Ps, DStr.Surface(Fd->Surf()).Surface(), aLoc, 0.);
/*
Handle(Geom2d_Curve) AdjustedPc;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(Bs, Cc->FirstParameter(), Cc->LastParameter(),
Pc, AdjustedPc);
Pc = AdjustedPc;
*/
BB.UpdateEdge(aNewEdge, Pc, Bs.Face(), 0.);
myNewEdges.Add(aNewEdge);
/////
Udeb = Cc->FirstParameter();
Ufin = Cc->LastParameter();
@@ -933,12 +1046,31 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
break;
}
}
//
}
Standard_Integer IndFv;
if (!myNewFaces.Contains(Fv))
myNewFaces.Add(Fv);
IndFv = myNewFaces.FindIndex(Fv);
if (!myFaceNewEdges.Contains(IndFv))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndFv, aList);
}
Standard_Integer IndE = myNewEdges.FindIndex(aNewEdge);
//QualifiedEdge aQE(IndE, Et);
if (Et == TopAbs_REVERSED)
IndE *= -1;
myFaceNewEdges.ChangeFromKey(IndFv).Append(IndE);
//Standard_Integer IndE_forNewFace = IndE;
Standard_Integer IndE_forNewFace = Abs(IndE);
//if (Fd->Orientation() == TopAbs_FORWARD)
if (!isfirst)
IndE_forNewFace *= -1;
//myFaceNewEdges.ChangeFromKey(IndexOfNewFace).Append(-IndE);
myFaceNewEdges.ChangeFromKey(IndexOfNewFace).Append(IndE_forNewFace);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch ,t_inter); //result perf condition if (inter)
ChFi3d_InitChron(ch); // init perf condition if (onsame && inters)
@@ -1246,6 +1378,8 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fop,Ubid,Ubid);
pop1 = Hc->Value(parVtx);
pop2 = Fiop.PCurveOnFace()->Value(Fiop.Parameter(isfirst));
if (!ChFi3d_IsInSingularity(Vtx, myVEMap))
ChFi3d_AdjustSecondPointToFirstPoint(pop1, pop2, Bop);
Hc = BRep_Tool::CurveOnSurface(Arcprol,Fv,Ubid,Ubid);
pv1 = Hc->Value(parVtx);
pv2 = p2dbout;
@@ -1268,127 +1402,101 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
zob2dv,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
//jgv
//TopoDS_Vertex CommonVertexForNewEdgeAndZobEdge = TopExp::FirstVertex(aNewEdge);
gp_Pnt aPnt = BRep_Tool::Pnt(Vtx);
gp_Pnt aPntFromCurve = zob3d->Value(zob3d->FirstParameter());
Standard_Real aDist = aPnt.Distance(aPntFromCurve);
BB.UpdateVertex(Vtx, 1.01*aDist);
TopoDS_Edge aZobEdge = BRepLib_MakeEdge(zob3d,
Vtx, VerFopFad[IFopArc],
zob3d->FirstParameter(), zob3d->LastParameter());
BB.UpdateEdge(aZobEdge, tolreached);
/*
Handle(Geom2d_Curve) AdjustedZob2dop;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(Bop, zob3d->FirstParameter(), zob3d->LastParameter(),
zob2dop, AdjustedZob2dop);
zob2dop = AdjustedZob2dop;
*/
BB.UpdateEdge(aZobEdge, zob2dop, Bop.Face(), 0.);
/*
Handle(Geom2d_Curve) AdjustedZob2dv;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(Bs, zob3d->FirstParameter(), zob3d->LastParameter(),
zob2dv, AdjustedZob2dv);
zob2dv = AdjustedZob2dv;
*/
BB.UpdateEdge(aZobEdge, zob2dv, Bs.Face(), 0.);
TopTools_ListOfShape aZobList, aNewZobList;
aZobList.Append(aZobEdge);
ChFi3d_SplitAndAdjust(aZobList, aNewZobList, Bop);
TopTools_ListIteratorOfListOfShape itl(aNewZobList);
for (; itl.More(); itl.Next())
myNewEdges.Add(itl.Value());
Udeb = zob3d->FirstParameter();
Ufin = zob3d->LastParameter();
TopOpeBRepDS_Curve Zob(zob3d,tolreached);
Standard_Integer IZob = DStr.AddCurve(Zob);
// it is determined if Fop has an edge of sewing
// it is determined if the curve has an intersection with the edge of sewing
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolv));
//TopoDS_Edge edgecouture;
//Standard_Boolean couture;
ChFi3d_Couture(Fop,couture,edgecouture);
if (couture && !BRep_Tool::Degenerated(edgecouture)) {
BRepLib_MakeEdge Bedge (zob3d);
TopoDS_Edge edg =Bedge. Edge();
BRepExtrema_ExtCC extCC (edgecouture,edg);
if (extCC.IsDone()&&extCC.NbExt()!=0) {
for (Standard_Integer i=1; i<=extCC.NbExt()&&!intcouture;i++) {
if (extCC.SquareDistance(i)<=1.e-8) {
par1=extCC.ParameterOnE1(i);
par2=extCC.ParameterOnE2(i);
gp_Pnt P1=extCC.PointOnE1(i);
TopOpeBRepDS_Point tpoint(P1,1.e-4);
indpt=DStr.AddPoint(tpoint);
intcouture=Standard_True;
curv1 = new Geom_TrimmedCurve(zob3d,Udeb,par2);
curv2 = new Geom_TrimmedCurve(zob3d,par2,Ufin);
TopOpeBRepDS_Curve tcurv1(curv1,tolreached);
TopOpeBRepDS_Curve tcurv2(curv2,tolreached);
Icurv1=DStr.AddCurve(tcurv1);
Icurv2=DStr.AddCurve(tcurv2);
}
}
}
Standard_Integer IndFop;
if (!myNewFaces.Contains(Fop))
myNewFaces.Add(Fop);
IndFop = myNewFaces.FindIndex(Fop);
if (!myFaceNewEdges.Contains(IndFop))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndFop, aList);
}
if (intcouture) {
// interference of curv1 and curv2 on Ishape
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolv));
ComputeCurve2d(curv1,Fop,c2d1);
Handle(TopOpeBRepDS_SurfaceCurveInterference)
InterFv = ChFi3d_FilCurveInDS(Icurv1,IShape,/*zob2dv*/c2d1,Et);
DStr.ChangeShapeInterferences(IShape).Append(InterFv);
ComputeCurve2d(curv2,Fop,c2d2);
InterFv = ChFi3d_FilCurveInDS(Icurv2,IShape,/*zob2dv*/c2d2,Et);
DStr.ChangeShapeInterferences(IShape).Append(InterFv);
// limitation of the sewing edge
Standard_Integer Iarc=DStr.AddShape(edgecouture);
Handle(TopOpeBRepDS_CurvePointInterference) Interfedge;
TopAbs_Orientation ori;
TopoDS_Vertex Vdeb,Vfin;
Vdeb=TopExp::FirstVertex(edgecouture);
Vfin=TopExp::LastVertex(edgecouture);
Standard_Real pard,parf;
pard=BRep_Tool::Parameter(Vdeb,edgecouture);
parf=BRep_Tool::Parameter(Vfin,edgecouture);
if (Abs(par1-pard)<Abs(parf-par1)) ori=TopAbs_REVERSED;
else ori=TopAbs_FORWARD;
Interfedge = ChFi3d_FilPointInDS(ori,Iarc,indpt,par1);
DStr.ChangeShapeInterferences(Iarc).Append(Interfedge);
// interference of curv1 and curv2 on Iop
Standard_Integer Iop = DStr.AddShape(Fop);
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolop));
Handle(TopOpeBRepDS_SurfaceCurveInterference) Interfop;
ComputeCurve2d(curv1,Fop,c2d1);
Interfop = ChFi3d_FilCurveInDS(Icurv1,Iop,c2d1,Et);
DStr.ChangeShapeInterferences(Iop).Append(Interfop);
ComputeCurve2d(curv2,Fop,c2d2);
Interfop = ChFi3d_FilCurveInDS(Icurv2,Iop,c2d2,Et);
DStr.ChangeShapeInterferences(Iop).Append(Interfop);
Handle(TopOpeBRepDS_CurvePointInterference)
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,Icurv1,IVtx,Udeb);
DStr.ChangeCurveInterferences(Icurv1).Append(interfprol);
interfprol = ChFi3d_FilPointInDS(TopAbs_REVERSED,Icurv1,indpt,par2);
DStr.ChangeCurveInterferences(Icurv1).Append(interfprol);
Standard_Integer icc = stripe->IndexPoint(isfirst,IFopArc);
interfprol = ChFi3d_FilPointInDS(TopAbs_FORWARD,Icurv2,indpt,par2);
DStr.ChangeCurveInterferences(Icurv2).Append(interfprol);
interfprol = ChFi3d_FilPointInDS(TopAbs_REVERSED,Icurv2,icc,Ufin);
DStr.ChangeCurveInterferences(Icurv2).Append(interfprol);
for (itl.Initialize(aNewZobList); itl.More(); itl.Next())
{
Standard_Integer IndZobE = myNewEdges.FindIndex(itl.Value());
//QualifiedEdge aQzobE(IndZobE, Et);
if (Et == TopAbs_REVERSED)
IndZobE *= -1;
myFaceNewEdges.ChangeFromKey(IndFv).Append(IndZobE);
//QualifiedEdge aQzopEonFop(IndZobE, TopAbs::Reverse(Et));
myFaceNewEdges.ChangeFromKey(IndFop).Append(-IndZobE);
}
else {
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolv));
Handle(TopOpeBRepDS_SurfaceCurveInterference)
InterFv = ChFi3d_FilCurveInDS(IZob,IShape,zob2dv,Et);
DStr.ChangeShapeInterferences(IShape).Append(InterFv);
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolop));
Standard_Integer Iop = DStr.AddShape(Fop);
Handle(TopOpeBRepDS_SurfaceCurveInterference)
Interfop = ChFi3d_FilCurveInDS(IZob,Iop,zob2dop,Et);
DStr.ChangeShapeInterferences(Iop).Append(Interfop);
Handle(TopOpeBRepDS_CurvePointInterference) interfprol;
#ifdef VARIANT1
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IVtx,Udeb);
#else
{
Standard_Integer IV2 = DStr.AddShape(V2); // VARIANT 2
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IV2,Udeb);
}
#endif
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
Standard_Integer icc = stripe->IndexPoint(isfirst,IFopArc);
interfprol = ChFi3d_FilPointInDS(TopAbs_REVERSED,IZob,icc,Ufin);
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
#ifdef VARIANT1
{
if (IFopArc == 1) box1.Add( zob3d->Value(Ufin) );
else box2.Add( zob3d->Value(Ufin) );
}
#else
{
// cut off existing Arcprol
Standard_Integer iArcprol = DStr.AddShape(Arcprol);
interfprol = ChFi3d_FilPointInDS(OVtx,iArcprol,icc,Udeb);
DStr.ChangeShapeInterferences(Arcprol).Append(interfprol);
}
#endif
Handle(TopOpeBRepDS_SurfaceCurveInterference)
InterFv = ChFi3d_FilCurveInDS(IZob,IShape,zob2dv,Et);
DStr.ChangeShapeInterferences(IShape).Append(InterFv);
Et = TopAbs::Reverse(TopAbs::Compose(OVtx,OArcprolop));
Standard_Integer Iop = DStr.AddShape(Fop);
Handle(TopOpeBRepDS_SurfaceCurveInterference)
Interfop = ChFi3d_FilCurveInDS(IZob,Iop,zob2dop,Et);
DStr.ChangeShapeInterferences(Iop).Append(Interfop);
Handle(TopOpeBRepDS_CurvePointInterference) interfprol;
#ifdef VARIANT1
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IVtx,Udeb);
#else
{
Standard_Integer IV2 = DStr.AddShape(V2); // VARIANT 2
interfprol = ChFi3d_FilVertexInDS(TopAbs_FORWARD,IZob,IV2,Udeb);
}
}
#endif
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
Standard_Integer icc = stripe->IndexPoint(isfirst,IFopArc);
interfprol = ChFi3d_FilPointInDS(TopAbs_REVERSED,IZob,icc,Ufin);
DStr.ChangeCurveInterferences(IZob).Append(interfprol);
#ifdef VARIANT1
{
if (IFopArc == 1) box1.Add( zob3d->Value(Ufin) );
else box2.Add( zob3d->Value(Ufin) );
}
#else
{
// cut off existing Arcprol
Standard_Integer iArcprol = DStr.AddShape(Arcprol);
interfprol = ChFi3d_FilPointInDS(OVtx,iArcprol,icc,Udeb);
DStr.ChangeShapeInterferences(Arcprol).Append(interfprol);
}
#endif
} //if (onsame && inters)
ChFi3d_EnlargeBox(DStr,stripe,Fd,box1,box2,isfirst);
if (CV1.IsOnArc()) {
ChFi3d_EnlargeBox(CV1.Arc(),myEFMap(CV1.Arc()),CV1.ParameterOnArc(),box1);

View File

@@ -94,6 +94,8 @@
#include <TopOpeBRepDS_Surface.hxx>
#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeVertex.hxx>
static void Reduce(const Standard_Real& p1,
const Standard_Real& p2,
@@ -146,6 +148,8 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
done = 0;
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
BRep_Builder BB;
TopoDS_Vertex Vertices [3];
//Information on fillets is extracted
//------------------------------------------------------
@@ -161,6 +165,9 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
ChFiDS_SequenceOfSurfData& SeqFil1 =
Corner1->ChangeSetOfSurfData()->ChangeSequence();
Handle(ChFiDS_SurfData)& Fd1 = SeqFil1.ChangeValue(IFd1);
//jgv
Standard_Integer IndexOfNewFace1 = Fd1->IndexOfFace();
/////
//the second
//----------
@@ -176,6 +183,9 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
ChFiDS_SequenceOfSurfData& SeqFil2 =
Corner2->ChangeSetOfSurfData()->ChangeSequence();
Handle(ChFiDS_SurfData)& Fd2 = SeqFil2.ChangeValue(IFd2);
//jgv
Standard_Integer IndexOfNewFace2 = Fd2->IndexOfFace();
/////
// The concavities are analysed in case of differents concavities,
// preview an evolutionary connection of type ThreeCorner of R to 0.
@@ -265,7 +275,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
gp_Pnt psp1 = Hpivot->Value(parCP1);
gp_Pnt psp2 = Hpivot->Value(parCP2);
Standard_Real sameparam = (psp1.Distance(psp2) < 10 * tolesp);
Standard_Boolean sameparam = (psp1.Distance(psp2) < 10 * tolesp);
TopoDS_Face FF1 = TopoDS::Face(DStr.Shape(Fd1->Index(IFaArc1)));
TopoDS_Face FF2 = TopoDS::Face(DStr.Shape(Fd2->Index(IFaArc2)));
@@ -346,6 +356,54 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
// CornerData are updated with results of the intersection.
Standard_Real WFirst = Gc->FirstParameter();
Standard_Real WLast = Gc->LastParameter();
//jgv
ChFiDS_FaceInterference& InterfArc1 = Fd1->ChangeInterference(IFaArc1);
Standard_Integer IndEarc1 = Fd1->IndexOfEdge(IFaArc1);
TopoDS_Edge EdgeArc1 = TopoDS::Edge(myNewEdges(IndEarc1));
EdgeArc1.Orientation(TopAbs_FORWARD);
Standard_Real fpar, lpar;
Handle(Geom_Curve) CurveEdgeArc1 = BRep_Tool::Curve(EdgeArc1, fpar, lpar);
if (isfirst1)
fpar = InterfArc1.FirstParameter();
else
lpar = InterfArc1.LastParameter();
BB.Range(EdgeArc1, fpar, lpar);
Vertices[1] = (isfirst1)? TopExp::FirstVertex(EdgeArc1)
: TopExp::LastVertex(EdgeArc1);
gp_Pnt aPnt = CurveEdgeArc1->Value((isfirst1)? fpar : lpar);
if (Vertices[1].IsNull())
{
Vertices[1] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirst1)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeArc1, Vertices[1].Oriented(OrOfVer));
}
else
BB.UpdateVertex(Vertices[1], aPnt, 0.);
ChFiDS_FaceInterference& InterfArc2 = Fd2->ChangeInterference(IFaArc2);
Standard_Integer IndEarc2 = Fd2->IndexOfEdge(IFaArc2);
TopoDS_Edge EdgeArc2 = TopoDS::Edge(myNewEdges(IndEarc2));
EdgeArc2.Orientation(TopAbs_FORWARD);
Handle(Geom_Curve) CurveEdgeArc2 = BRep_Tool::Curve(EdgeArc2, fpar, lpar);
if (isfirst2)
fpar = InterfArc2.FirstParameter();
else
lpar = InterfArc2.LastParameter();
BB.Range(EdgeArc2, fpar, lpar);
TopoDS_Vertex aVertexArc2 = (isfirst2)? TopExp::FirstVertex(EdgeArc2)
: TopExp::LastVertex(EdgeArc2);
if (!aVertexArc2.IsSame(Vertices[1]))
{
BB.Remove(EdgeArc2, aVertexArc2);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirst2)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeArc2, Vertices[1].Oriented(OrOfVer));
}
/////
Standard_Integer Ipoin1;
Standard_Integer Ipoin2;
ChFiDS_CommonPoint& cpco1 = Fd1->ChangeVertex(isfirst1,IFaCo1);
@@ -363,6 +421,32 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
cpco1.SetPoint(PFaCo);
cpco1.SetTolerance(Max(tolreached,tolpco));
Fd1->ChangeInterference(IFaCo1).SetParameter(UIntPC1,isfirst1);
//jgv
ChFiDS_FaceInterference& Interf1 = Fd1->ChangeInterference(IFaCo1);
Standard_Integer IndEsurf1 = Fd1->IndexOfEdge(IFaCo1);
TopoDS_Edge EdgeSurf1 = TopoDS::Edge(myNewEdges(IndEsurf1));
EdgeSurf1.Orientation(TopAbs_FORWARD);
Handle(Geom_Curve) CurveEdgeSurf1 = BRep_Tool::Curve(EdgeSurf1, fpar, lpar);
//BRep_Tool::Range(EdgeSurf, fpar, lpar);
if (isfirst1)
fpar = Interf1.FirstParameter();
else
lpar = Interf1.LastParameter();
BB.Range(EdgeSurf1, fpar, lpar);
Vertices[2] = (isfirst1)? TopExp::FirstVertex(EdgeSurf1)
: TopExp::LastVertex(EdgeSurf1);
aPnt = CurveEdgeSurf1->Value((isfirst1)? fpar : lpar);
if (Vertices[2].IsNull())
{
Vertices[2] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirst1)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeSurf1, Vertices[2].Oriented(OrOfVer));
}
else
BB.UpdateVertex(Vertices[2], aPnt, 0.);
/////
tolparc = Max(tolparc,tolreached);
cparc1.SetTolerance(Max(tolparc,tolreached));
Ipoin1 = ChFi3d_IndexPointInDS(Fd1->Vertex(isfirst1,1),DStr);
@@ -374,6 +458,69 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Corner2->SetCurve(ICurv,isfirst2);
Corner2->ChangePCurve(isfirst2) = PGc2;
Fd2->ChangeInterference(IFaCo2).SetParameter(UIntPC2,isfirst2);
//jgv
ChFiDS_FaceInterference& Interf2 = Fd2->ChangeInterference(IFaCo2);
Standard_Integer IndEsurf2 = Fd2->IndexOfEdge(IFaCo2);
TopoDS_Edge EdgeSurf2 = TopoDS::Edge(myNewEdges(IndEsurf2));
EdgeSurf2.Orientation(TopAbs_FORWARD);
Handle(Geom_Curve) CurveEdgeSurf2 = BRep_Tool::Curve(EdgeSurf2, fpar, lpar);
//BRep_Tool::Range(EdgeSurf, fpar, lpar);
if (isfirst2)
fpar = Interf2.FirstParameter();
else
lpar = Interf2.LastParameter();
BB.Range(EdgeSurf2, fpar, lpar);
TopoDS_Vertex aVertex2 = (isfirst2)? TopExp::FirstVertex(EdgeSurf2)
: TopExp::LastVertex(EdgeSurf2);
if (!aVertex2.IsSame(Vertices[2]))
{
BB.Remove(EdgeSurf2, aVertex2);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirst2)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeSurf2, Vertices[2].Oriented(OrOfVer));
}
//Create new edge
gp_Pnt aPntVer = BRep_Tool::Pnt(Vertices[IFaArc1]);
gp_Pnt aPntFromCurve = Gc->Value(WFirst);
Standard_Real aDist = aPntVer.Distance(aPntFromCurve);
BB.UpdateVertex(Vertices[IFaArc1], 1.01*aDist);
TopoDS_Edge aNewEdge = BRepLib_MakeEdge(Gc,
Vertices[IFaArc1], Vertices[IFaCo1],
WFirst, WLast);
BB.UpdateEdge(aNewEdge, tolreached);
TopLoc_Location aLoc;
BB.UpdateEdge(aNewEdge, PGc1, DStr.Surface(Fd1->Surf()).Surface(), aLoc, 0.);
BB.UpdateEdge(aNewEdge, PGc2, DStr.Surface(Fd2->Surf()).Surface(), aLoc, 0.);
myNewEdges.Add(aNewEdge);
//Temporary
//TopAbs_Orientation Or1 = Fd1->Orientation();
//TopAbs_Orientation Or2 = Fd2->Orientation();
///////////
Standard_Integer IndE = myNewEdges.FindIndex(aNewEdge);
Standard_Boolean IsFirstArcForward = Standard_True;
const TColStd_ListOfInteger& Elist = myFaceNewEdges.FindFromKey(IndexOfNewFace1);
TColStd_ListIteratorOfListOfInteger itl(Elist);
for (; itl.More(); itl.Next())
{
Standard_Integer anIndexOfEdge = itl.Value();
if (Abs(anIndexOfEdge) == IndEarc1)
{
IsFirstArcForward = (anIndexOfEdge > 0);
break;
}
}
if ((isfirst1 && IFaArc1 == 1 && IsFirstArcForward) ||
(!isfirst1 && IFaArc1 == 2 && IsFirstArcForward))
IndE *= -1;
//QualifiedEdge aQE(IndE, Et);
myFaceNewEdges.ChangeFromKey(IndexOfNewFace1).Append(IndE);
Standard_Integer IndE_forNewFace2 = IndE;
if (Fd1->Orientation() == Fd2->Orientation())
IndE_forNewFace2 *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfNewFace2).Append(IndE_forNewFace2);
/////
Fd2->ChangeVertex(isfirst2,IFaCo2) = Fd1->Vertex(isfirst1,IFaCo1);
Fd2->ChangeVertex(isfirst2,IFaArc2) = Fd1->Vertex(isfirst1,IFaArc1);
if (IFaCo1!=IFaCo2) Corner2->SetOrientation(TopAbs_REVERSED,isfirst2);
@@ -414,6 +561,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Standard_Integer IFaCoBig, IFaCoSma, IFaArcBig, IFaArcSma;
Standard_Boolean isfirstBig, isfirstSma;
Standard_Real UIntPCBig, UIntPCSma;
Standard_Integer IndexOfSmaNewFace, IndexOfBigNewFace;
if((parcrois && parCP2 > parCP1) || (!parcrois && parCP2 < parCP1)){
UIntPCBig = UIntPC2; UIntPCSma = UIntPC1;
@@ -423,6 +571,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
IFaCoBig = IFaCo2; IFaCoSma = IFaCo1;
IFaArcBig = IFaArc2; IFaArcSma = IFaArc1;
isfirstBig = isfirst2; isfirstSma = isfirst1;
IndexOfSmaNewFace = IndexOfNewFace1; IndexOfBigNewFace = IndexOfNewFace2;
}
else{
UIntPCBig = UIntPC1, UIntPCSma = UIntPC2;
@@ -432,6 +581,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
IFaCoBig = IFaCo1; IFaCoSma = IFaCo2;
IFaArcBig = IFaArc1; IFaArcSma = IFaArc2;
isfirstBig = isfirst1; isfirstSma = isfirst2;
IndexOfSmaNewFace = IndexOfNewFace2; IndexOfBigNewFace = IndexOfNewFace1;
}
//Intersection of the big with the small :
@@ -511,10 +661,62 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
psmaco.SetPoint(PFaCo);
psmaco.SetTolerance(Max(tolpco,tolreached));
SmaFD->ChangeInterference(IFaCoSma).SetParameter(UIntPCSma,isfirstSma);
//jgv
ChFiDS_FaceInterference& SmaInterf = SmaFD->ChangeInterference(IFaCoSma);
Standard_Integer IndEsmall = SmaFD->IndexOfEdge(IFaCoSma);
TopoDS_Edge EdgeSmall = TopoDS::Edge(myNewEdges(IndEsmall));
EdgeSmall.Orientation(TopAbs_FORWARD);
Standard_Real fpar, lpar;
Handle(Geom_Curve) CurveEdgeSma = BRep_Tool::Curve(EdgeSmall, fpar, lpar);
//BRep_Tool::Range(EdgeSmall, fpar, lpar);
if (isfirstSma)
fpar = SmaInterf.FirstParameter();
else
lpar = SmaInterf.LastParameter();
BB.Range(EdgeSmall, fpar, lpar);
Vertices[2] = (isfirstSma)? TopExp::FirstVertex(EdgeSmall)
: TopExp::LastVertex(EdgeSmall);
gp_Pnt aPnt = CurveEdgeSma->Value((isfirstSma)? fpar : lpar);
if (Vertices[2].IsNull())
{
Vertices[2] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirstSma)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeSmall, Vertices[2].Oriented(OrOfVer));
}
else
BB.UpdateVertex(Vertices[2], aPnt, 0.);
/////
psmamil.Reset();
psmamil.SetPoint(PMil);
psmamil.SetTolerance(Max(tolpmil,tolreached));
SmaFD->ChangeInterference(IFaArcSma).SetParameter(wi,isfirstSma);
//jgv
ChFiDS_FaceInterference& SmaArcInterf = SmaFD->ChangeInterference(IFaArcSma);
Standard_Integer IndEarcsmall = SmaFD->IndexOfEdge(IFaArcSma);
TopoDS_Edge EdgeArcSmall = TopoDS::Edge(myNewEdges(IndEarcsmall));
EdgeArcSmall.Orientation(TopAbs_FORWARD);
Handle(Geom_Curve) CurveEdgeArcSma = BRep_Tool::Curve(EdgeArcSmall, fpar, lpar);
if (isfirstSma)
fpar = SmaArcInterf.FirstParameter();
else
lpar = SmaArcInterf.LastParameter();
BB.Range(EdgeArcSmall, fpar, lpar);
Vertices[1] = (isfirstSma)? TopExp::FirstVertex(EdgeArcSmall)
: TopExp::LastVertex(EdgeArcSmall);
aPnt = CurveEdgeArcSma->Value((isfirstSma)? fpar : lpar);
if (Vertices[1].IsNull())
{
Vertices[1] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirstSma)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeArcSmall, Vertices[1].Oriented(OrOfVer));
}
else
BB.UpdateVertex(Vertices[1], aPnt, 0.);
/////
IpointCo = ChFi3d_IndexPointInDS(psmaco,DStr);
SmaCD->SetIndexPoint(IpointCo,isfirstSma,IFaCoSma);
IpointMil = ChFi3d_IndexPointInDS(psmamil,DStr);
@@ -525,6 +727,87 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
BigCD->SetIndexPoint(IpointCo,isfirstBig,IFaCoBig);
BigFD->ChangeVertex(isfirstBig,IFaCoBig) = psmaco;
BigFD->ChangeInterference(IFaCoBig).SetParameter(UIntPCBig,isfirstBig);
//jgv
ChFiDS_FaceInterference& BigInterf = BigFD->ChangeInterference(IFaCoBig);
Standard_Integer IndEbig = BigFD->IndexOfEdge(IFaCoBig);
TopoDS_Edge EdgeBig = TopoDS::Edge(myNewEdges(IndEbig));
EdgeBig.Orientation(TopAbs_FORWARD);
//???
TopoDS_Vertex BigVer [3];
Handle(Geom_Curve) CurveEdgeBig = BRep_Tool::Curve(EdgeBig, fpar, lpar);
//BRep_Tool::Range(EdgeBig, fpar, lpar);
if (isfirstBig)
fpar = BigInterf.FirstParameter();
else
lpar = BigInterf.LastParameter();
BB.Range(EdgeBig, fpar, lpar);
BigVer[2] = (isfirstBig)? TopExp::FirstVertex(EdgeBig)
: TopExp::LastVertex(EdgeBig);
aPnt = CurveEdgeBig->Value((isfirstBig)? fpar : lpar);
//if (BigVer[2].IsNull())
if (!BigVer[2].IsSame(Vertices[2]))
{
//BigVer[2] = BRepLib_MakeVertex(aPnt);
BB.Remove(EdgeBig, BigVer[2]);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirstBig)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeBig, Vertices[2].Oriented(OrOfVer));
}
/////
ChFiDS_FaceInterference& BigArcInterf = BigFD->ChangeInterference(IFaArcBig);
Standard_Integer IndEarcbig = BigFD->IndexOfEdge(IFaArcBig);
TopoDS_Edge EdgeArcBig = TopoDS::Edge(myNewEdges(IndEarcbig));
EdgeArcBig.Orientation(TopAbs_FORWARD);
//???
Handle(Geom_Curve) CurveEdgeArcBig = BRep_Tool::Curve(EdgeArcBig, fpar, lpar);
if (isfirstBig)
fpar = BigArcInterf.FirstParameter();
else
lpar = BigArcInterf.LastParameter();
BB.Range(EdgeArcBig, fpar, lpar);
BigVer[1] = (isfirstBig)? TopExp::FirstVertex(EdgeArcBig)
: TopExp::LastVertex(EdgeArcBig);
aPnt = CurveEdgeArcBig->Value((isfirstBig)? fpar : lpar);
if (BigVer[1].IsNull())
{
BigVer[1] = BRepLib_MakeVertex(aPnt);
TopAbs_Orientation OrOfVer = TopAbs_FORWARD;
if (!isfirstBig)
OrOfVer = TopAbs_REVERSED;
BB.Add(EdgeArcBig, BigVer[1].Oriented(OrOfVer));
}
else
BB.UpdateVertex(BigVer[1], aPnt, 0.);
/////
//Create new edge
gp_Pnt aPntVer = BRep_Tool::Pnt(Vertices[2]);
gp_Pnt aPntFromCurve = Gc->Value(WFirst);
Standard_Real aDist = aPntVer.Distance(aPntFromCurve);
BB.UpdateVertex(Vertices[2], 1.01*aDist);
TopoDS_Edge aNewEdge = BRepLib_MakeEdge(Gc,
Vertices[2], Vertices[1],
WFirst, WLast);
BB.UpdateEdge(aNewEdge, tolreached);
TopLoc_Location aLoc;
BB.UpdateEdge(aNewEdge, PGc1, DStr.Surface(SmaFD->Surf()).Surface(), aLoc, 0.);
BB.UpdateEdge(aNewEdge, PGc2, DStr.Surface(BigFD->Surf()).Surface(), aLoc, 0.);
myNewEdges.Add(aNewEdge);
Standard_Integer IndE = myNewEdges.FindIndex(aNewEdge);
if (isfirstSma && IFaArcSma == 1 ||
!isfirstSma && IFaArcSma == 2)
IndE *= -1;
//QualifiedEdge aQE(IndE, Et);
myFaceNewEdges.ChangeFromKey(IndexOfSmaNewFace).Append(IndE);
Standard_Integer IndE_forBigNewFace = IndE;
if (SmaFD->Orientation() == BigFD->Orientation())
IndE_forBigNewFace *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfBigNewFace).Append(IndE_forBigNewFace);
/////
TopOpeBRepDS_ListOfInterference& Li = DStr.ChangeCurveInterferences(ICurv);
Handle(TopOpeBRepDS_CurvePointInterference) Interfp;
@@ -619,6 +902,37 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
// End of update of the BigCD and the DS.
WFirst = Gc->FirstParameter();
WLast = Gc->LastParameter();
//Create additional new edge
TopoDS_Edge anAdditionalNewEdge = BRepLib_MakeEdge(Gc,
Vertices[1], BigVer[1],
WFirst, WLast);
BB.UpdateEdge(anAdditionalNewEdge, tolreached);
BB.UpdateEdge(anAdditionalNewEdge, PGc1, F, 0.);
BB.UpdateEdge(anAdditionalNewEdge, PGc2, DStr.Surface(BigFD->Surf()).Surface(), aLoc, 0.);
myNewEdges.Add(anAdditionalNewEdge);
IndE = myNewEdges.FindIndex(anAdditionalNewEdge);
if (IndE_forBigNewFace < 0)
IndE *= -1;
//QualifiedEdge aQE(IndE, Et);
myFaceNewEdges.ChangeFromKey(IndexOfBigNewFace).Append(IndE);
Standard_Integer IndE_forOldFace = IndE;
if (BigFD->Orientation() == F.Orientation())
IndE_forOldFace *= -1;
Standard_Integer IndF;
if (!myNewFaces.Contains(F))
myNewFaces.Add(F);
IndF = myNewFaces.FindIndex(F);
if (!myFaceNewEdges.Contains(IndF))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndF, aList);
}
myFaceNewEdges.ChangeFromKey(IndF).Append(IndE_forOldFace);
/////
ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc,tolreached));
cpend.SetTolerance(Max(cpend.Tolerance(),tolreached));
IpointArc = ChFi3d_IndexPointInDS(cpend,DStr);

View File

@@ -55,8 +55,10 @@
#include <BRepAdaptor_HSurface.hxx>
#include <BRepAlgo_NormalProjection.hxx>
#include <BRepBlend_Line.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRepLib_CheckCurveOnSurface.hxx>
#include <BRepTools.hxx>
#include <BRepTopAdaptor_TopolTool.hxx>
#include <ChFi3d_Builder.hxx>
@@ -154,6 +156,23 @@ extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer & ch,Standard_Real& time);
#endif
//=======================================================================
//function : UpdateEdgeTolerance
//purpose :
//=======================================================================
static void UpdateEdgeTolerance(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace)
{
BRep_Builder BB;
BRepLib_CheckCurveOnSurface aCS(theEdge, theFace);
aCS.Perform();
if (aCS.IsDone())
{
Standard_Real aMaxDist = aCS.MaxDistance();
BB.UpdateEdge(theEdge, aMaxDist);
}
}
//=======================================================================
//function : Indices
@@ -1115,6 +1134,11 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
CD.SetValue(0,cnext);
Index.SetValue(0,ChFi3d_IndexOfSurfData(V1,cnext,sense));
sens.SetValue(0,sense);
//jgv
//const Handle(ChFiDS_SurfData)& SDfa = CD(0)->SetOfSurfData()->Value(Index.Value(0));
//Standard_Integer indfa = SDfa->IndexOfFace();
//const TopoDS_Face& aFace = TopoDS::Face(myNewFaces(indfa));
/////
numfa.SetValue(0 ,1,SurfIndex(CD, 0, Index.Value(0), FACE2));
numfa.SetValue(1 ,0, numfa.Value(0 ,1));
Fcur=TopoDS::Face(DStr.Shape(numfa.Value(0,1)));
@@ -2053,7 +2077,13 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
// declaration for plate
GeomPlate_BuildPlateSurface PSurf(3,10,3,tol2d,tolesp,angular);
// calculation of curves on surface for each stripe
// calculation of curves on surface for each stripe
//jgv
BRep_Builder BB;
ChFiDS_SequenceOfSurfData SeqSD;
TopTools_Array1OfShape aVertices(0, nedge), aNewEdges(0, nedge);
/////
for (ic=0;ic<nedge;ic++) {
gp_Pnt2d p2d1, p2d2;
if (!sharp.Value(ic)) {
@@ -2063,7 +2093,13 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Calcul_P2dOnSurf(CD.Value(ic),jfp,i.Value(ic,icmoins),p.Value(ic,icmoins),p2d1);
Calcul_P2dOnSurf(CD.Value(ic),jf.Value(ic),i.Value(ic,icplus),p.Value(ic,icplus),p2d2);
// if (i[ic][icplus]!= i[ic][icmoins]) std::cout<<"probleme surface"<<std::endl;
indice= SurfIndex(CD, ic, i.Value(ic,icplus), ChFiSURFACE);
//jgv
const Handle(ChFiDS_SurfData)& aSD = CD(ic)->SetOfSurfData()->Value(i.Value(ic,icplus));
SeqSD.Append(aSD);
Standard_Integer ind_surf = aSD->IndexOfFace();
const TopoDS_Face& FaceSurf = TopoDS::Face(myNewFaces(ind_surf));
/////
indice = SurfIndex(CD, ic, i.Value(ic,icplus), ChFiSURFACE);
Handle (GeomAdaptor_HSurface) Asurf =
new GeomAdaptor_HSurface(DStr.Surface(indice).Surface());
// calculation of curve 2d
@@ -2086,6 +2122,122 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
isfirst=(sens.Value(ic)==1);
GeomLib::BuildCurve3d(tolapp,CurvOnS,CurvOnS.FirstParameter(),
CurvOnS.LastParameter(),Curv3d,maxapp,avedev);
//jgv
Standard_Integer IndE1 = aSD->IndexOfEdge(jfp);
Standard_Integer IndE2 = aSD->IndexOfEdge(jf.Value(ic));
const TopoDS_Edge& EdgeOnS1 = TopoDS::Edge(myNewEdges(IndE1));
const TopoDS_Edge& EdgeOnS2 = TopoDS::Edge(myNewEdges(IndE2));
TopoDS_Vertex VertexOnE1, VertexOnE2;
TopoDS_Vertex FirstVonE1, LastVonE1, FirstVonE2, LastVonE2;
TopExp::Vertices(EdgeOnS1, FirstVonE1, LastVonE1);
if (isfirst && !FirstVonE1.IsNull())
{
VertexOnE1 = FirstVonE1;
//aVertices(ic) = FirstVonE1;
}
else if (!isfirst && !LastVonE1.IsNull())
{
VertexOnE1 = LastVonE1;
//aVertices(ic) = LastVonE1;
}
TopExp::Vertices(EdgeOnS2, FirstVonE2, LastVonE2);
if (isfirst && !FirstVonE2.IsNull())
{
VertexOnE2 = FirstVonE2;
//aVertices(ic+1) = FirstVonE2;
}
else if (!isfirst && !LastVonE2.IsNull())
{
VertexOnE2 = LastVonE2;
//aVertices(ic+1) = LastVonE2;
}
TopoDS_Edge aNewEdge;
BB.MakeEdge(aNewEdge, Curv3d, maxapp);
BB.UpdateEdge(aNewEdge, pcurve, FaceSurf, Precision::Confusion());
BB.Range(aNewEdge, CurvOnS.FirstParameter(), CurvOnS.LastParameter());
gp_Pnt FirstPnt = Curv3d->Value(CurvOnS.FirstParameter());
gp_Pnt LastPnt = Curv3d->Value(CurvOnS.LastParameter());
//TopoDS_Vertex aV1, aV2;
//gp_Pnt PntForV1, PntForV2;
Standard_Real fpar, lpar, fpar2, lpar2;
BRep_Tool::Range(EdgeOnS1, fpar, lpar);
BRep_Tool::Range(EdgeOnS2, fpar2, lpar2);
if (!VertexOnE1.IsNull())
BB.UpdateVertex(VertexOnE1, FirstPnt, Precision::Confusion());
if (!VertexOnE2.IsNull())
BB.UpdateVertex(VertexOnE2, LastPnt, Precision::Confusion());
if (aVertices(ic).IsNull())
{
if (VertexOnE1.IsNull())
aVertices(ic) = BRepLib_MakeVertex(FirstPnt);
else
aVertices(ic) = VertexOnE1;
}
else
{
const TopoDS_Vertex& aV1 = TopoDS::Vertex(aVertices(ic));
gp_Pnt aPnt = BRep_Tool::Pnt(aV1);
gp_Pnt MidPnt((aPnt.XYZ() + FirstPnt.XYZ())/2);
BB.UpdateVertex(aV1, MidPnt, 1.001*aPnt.Distance(MidPnt));
}
if (aVertices(ic+1).IsNull())
{
if (VertexOnE2.IsNull())
aVertices(ic+1) = BRepLib_MakeVertex(LastPnt);
else
aVertices(ic+1) = VertexOnE2;
}
else
{
const TopoDS_Vertex& aV2 = TopoDS::Vertex(aVertices(ic+1));
gp_Pnt aPnt = BRep_Tool::Pnt(aV2);
gp_Pnt MidPnt((aPnt.XYZ() + LastPnt.XYZ())/2);
BB.UpdateVertex(aV2, MidPnt, 1.001*aPnt.Distance(MidPnt));
}
TopoDS_Edge F_EdgeOnS1 = EdgeOnS1;
F_EdgeOnS1.Orientation(TopAbs_FORWARD);
TopoDS_Edge F_EdgeOnS2 = EdgeOnS2;
F_EdgeOnS2.Orientation(TopAbs_FORWARD);
if (isfirst)
{
BB.Range(F_EdgeOnS1, p.Value(ic,icmoins), lpar);
if (VertexOnE1.IsNull())
BB.Add(F_EdgeOnS1, aVertices(ic).Oriented(TopAbs_FORWARD));
//else
//BB.UpdateVertex(VertexOnE1, );
BB.Range(F_EdgeOnS2, p.Value(ic,icplus), lpar2);
if (VertexOnE2.IsNull())
BB.Add(F_EdgeOnS2, aVertices(ic+1).Oriented(TopAbs_FORWARD));
//else
}
else
{
BB.Range(F_EdgeOnS1, fpar, p.Value(ic,icmoins));
if (VertexOnE1.IsNull())
BB.Add(F_EdgeOnS1, aVertices(ic).Oriented(TopAbs_REVERSED));
//else
BB.Range(F_EdgeOnS2, fpar2, p.Value(ic,icplus));
if (VertexOnE2.IsNull())
BB.Add(F_EdgeOnS2, aVertices(ic+1).Oriented(TopAbs_REVERSED));
//else
}
BB.Add(aNewEdge, aVertices(ic).Oriented(TopAbs_FORWARD));
BB.Add(aNewEdge, aVertices(ic+1).Oriented(TopAbs_REVERSED));
if (ic == 0)
aVertices(nedge) = aVertices(0);
myNewEdges.Add(aNewEdge);
aNewEdges(ic) = aNewEdge;
//Standard_Integer IndNewEdge = myNewEdges.FindIndex(aNewEdge);
//myFaceNewEdges.ChangeFromKey(ind_surf).Append(IndNewEdge);
/////
TopOpeBRepDS_Curve tcurv3d( Curv3d,maxapp);
indcurve3d.SetValue(n3d,DStr.AddCurve(tcurv3d));
gp_Pnt point1,point2;
@@ -2240,7 +2392,12 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
}
p2d2 = curv2d2 ->Value(p.Value(icplus,ic));
Asurf = new GeomAdaptor_HSurface(BRep_Tool::Surface(TopoDS::Face(Fvive.Value(ic,icplus))));
//jgv
const TopoDS_Face& Aface = TopoDS::Face(Fvive.Value(ic,icplus));
//Standard_Integer IndAface = myNewFaces.FindIndex(Aface);
/////
//Asurf = new GeomAdaptor_HSurface(BRep_Tool::Surface(TopoDS::Face(Fvive.Value(ic,icplus))));
Asurf = new GeomAdaptor_HSurface(BRep_Tool::Surface(Aface));
Standard_Real tolu,tolv,ratio;
tolu=Asurf->Surface().UResolution(1.e-3);
tolv=Asurf->Surface().VResolution(1.e-3);
@@ -2382,6 +2539,43 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
parfin= CurvOnS.LastParameter();
curveint= new Geom_TrimmedCurve(Curv3d,pardeb,parfin);
}
//jgv
else
{
pardeb = curveint->FirstParameter();
parfin = curveint->LastParameter();
}
/////
//jgv
TopoDS_Edge aNewEdge;
BB.MakeEdge(aNewEdge, curveint, maxapp1);
BB.UpdateEdge(aNewEdge, pcurve, Aface, Precision::Confusion());
BB.Range(aNewEdge, pardeb, parfin);
gp_Pnt Pnts [2];
Pnts[0] = curveint->Value(pardeb);
Pnts[1] = curveint->Value(parfin);
TopoDS_Vertex aVV [2];
for (Standard_Integer indv = 0; indv < 2; indv++)
{
if (aVertices(ic + indv).IsNull())
aVV[indv] = BRepLib_MakeVertex(Pnts[indv]);
else
{
aVV[indv] = TopoDS::Vertex(aVertices(ic + indv));
gp_Pnt aPnt = BRep_Tool::Pnt(aVV[indv]);
gp_Pnt MidPnt((aPnt.XYZ() + Pnts[indv].XYZ())/2);
BB.UpdateVertex(aVV[indv], MidPnt, 1.001*aPnt.Distance(MidPnt));
}
aVertices(ic + indv) = aVV[indv];
}
BB.Add(aNewEdge, aVV[0].Oriented(TopAbs_FORWARD));
BB.Add(aNewEdge, aVV[1].Oriented(TopAbs_REVERSED));
myNewEdges.Add(aNewEdge);
aNewEdges(ic) = aNewEdge;
//Standard_Integer IndNewEdge = myNewEdges.FindIndex(aNewEdge);
//myFaceNewEdges.ChangeFromKey(IndAface).Append(IndNewEdge);
/////
//storage in the DS
TopOpeBRepDS_Curve tcurv3d( curveint,maxapp1);
@@ -2734,6 +2928,18 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
// if (scal>0) orplate=orsurfdata;
// else orplate=TopAbs::Reverse(orsurfdata);
orplate = PlateOrientation(Surf,PSurf.Curves2d(),SumFaceNormalAtV1);
//jgv
TopoDS_Face aNewFace;
BB.MakeFace(aNewFace);
TopLoc_Location aLoc;
BB.UpdateFace(aNewFace, Surf, aLoc, Precision::Confusion());
aNewFace.Orientation(orplate);
Standard_Integer IndNewFace = myNewFaces.Add(aNewFace);
myIndsChFiFaces.Add(IndNewFace);
TColStd_ListOfInteger aList;
myFaceNewEdges.Add(IndNewFace, aList);
/////
// creation of solidinterderence for Plate
Handle(TopOpeBRepDS_SolidSurfaceInterference) SSI =
@@ -2830,8 +3036,14 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Indices(nedge,ic,icplus,icmoins);
isfirst=(sens.Value(ic)==1);
// calculate curves interference relative to stripes
//jgv
const Handle(ChFiDS_SurfData)& aSD = CD(ic)->SetOfSurfData()->Value(i.Value(ic,icplus));
Standard_Integer ind_surf = aSD->IndexOfFace();
//const TopoDS_Face& FaceSurf = TopoDS::Face(myNewFaces(ind_surf));
/////
// calculate curves interference relative to stripes
apperror=Mapp.CriterionError()*coef;
pardeb=CD.Value(ic)->PCurve(isfirst)->FirstParameter();
parfin=CD.Value(ic)->PCurve(isfirst)->LastParameter();
@@ -2848,7 +3060,23 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
TopOpeBRepDS_Point& tpt1= DStr.ChangePoint(indpoint(ic,0));
TopOpeBRepDS_Point& tpt2= DStr.ChangePoint(indpoint(ic,1));
tpt1.Tolerance (tpt1.Tolerance()+apperror);
tpt2.Tolerance (tpt2.Tolerance()+apperror );
tpt2.Tolerance (tpt2.Tolerance()+apperror );
//jgv
Handle(Geom2d_Curve) aPCurve = PSurf.Curves2d()->Value(n3d);
BB.UpdateEdge(TopoDS::Edge(aNewEdges(ic)), aPCurve, aNewFace, Precision::Confusion());
UpdateEdgeTolerance(TopoDS::Edge(aNewEdges(ic)), aNewFace);
Standard_Integer IndE = myNewEdges.FindIndex(aNewEdges(ic));
//Temporary
IndE *= -1;
///////////
myFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE);
IndE *= -1;
if (orplate != aSD->Orientation())
IndE *= -1;
myFaceNewEdges.ChangeFromKey(ind_surf).Append(IndE);
/////
// calculate surfaceinterference
Interfc=ChFi3d_FilCurveInDS(indcurve3d.Value(n3d),Isurf,
@@ -2889,6 +3117,26 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
// actual connection
if (!moresurf.Value(ic)){
n3d++;
//jgv
const TopoDS_Face& Aface = TopoDS::Face(Fvive.Value(ic,icplus));
Standard_Integer IndAface = myNewFaces.FindIndex(Aface);
Handle(Geom2d_Curve) aPCurve = PSurf.Curves2d()->Value(n3d);
BB.UpdateEdge(TopoDS::Edge(aNewEdges(ic)), aPCurve, aNewFace, Precision::Confusion());
UpdateEdgeTolerance(TopoDS::Edge(aNewEdges(ic)), aNewFace);
Standard_Integer IndE = myNewEdges.FindIndex(aNewEdges(ic));
//Temporary
IndE *= -1;
///////////
myFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE);
IndE *= -1;
if (orplate != Aface.Orientation())
IndE *= -1;
myFaceNewEdges.ChangeFromKey(IndAface).Append(IndE);
/////
TopOpeBRepDS_Curve& tcourb1 = DStr.ChangeCurve(indcurve3d.Value(n3d));
tcourb1.Tolerance(tcourb1.Tolerance()+apperror);
if (!deuxconges) {

View File

@@ -1520,7 +1520,7 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
Inside,Appro,Forward,Soldep,intf,intl,
gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,*pFunc,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
done = CompleteData(Data,*pFunc,lin,S1,S2,Or,0,gd1,gd2,gf1,gf2); //jgv 0???
if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
else if (chsp->IsChamfer() == ChFiDS_TwoDist) {
@@ -1571,7 +1571,7 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
Inside,Appro,Forward,Soldep,intf,intl,
gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,*pFunc,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
done = CompleteData(Data,*pFunc,lin,S1,S2,Or,0,gd1,gd2,gf1,gf2); //jgv 0???
if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
else { //distance and angle
@@ -1591,7 +1591,7 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
done = CompleteData(Data,Func,lin,S1,S2,Or,0,gd1,gd2,gf1,gf2); //jgv 0???
if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}

View File

@@ -1279,7 +1279,7 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
ChFi3d_InitChron(ch);// init perf CompleteData
#endif
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
done = CompleteData(Data,Func,lin,S1,S2,Or,0,gd1,gd2,gf1,gf2); //jgv 0???
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData
@@ -1313,7 +1313,7 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
ChFi3d_InitChron(ch);// init perf CompleteData
#endif
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
done = CompleteData(Data,Func,lin,S1,S2,Or,0,gd1,gd2,gf1,gf2); //jgv 0???
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData

View File

@@ -88,6 +88,8 @@
#include <TopOpeBRepDS_DataStructure.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopOpeBRepDS_Surface.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
#ifdef DRAW
#include <DrawTrSurf.hxx>
@@ -392,6 +394,14 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(ChFiDS_SurfData)&
fdpiv = CD[pivot]->ChangeSetOfSurfData()->ChangeValue(i[pivot][deb]);
//jgv
Standard_Integer IndexOfNewFaceDeb = fddeb->IndexOfFace();
Standard_Integer IndexOfNewFaceFin = fdfin->IndexOfFace();
Standard_Integer IndexOfNewFacePiv = fdpiv->IndexOfFace();
const TopoDS_Face& FaceDeb = TopoDS::Face(myNewFaces(IndexOfNewFaceDeb));
const TopoDS_Face& FaceFin = TopoDS::Face(myNewFaces(IndexOfNewFaceFin));
const TopoDS_Face& FacePiv = TopoDS::Face(myNewFaces(IndexOfNewFacePiv));
/////
// HSurfaces and other suitable tools are constructed.
// ----------------------------------------------------------
@@ -405,16 +415,23 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
const ChFiDS_FaceInterference& bid2 = CD[pivot]->SetOfSurfData()->
Value(i[pivot][deb])->InterferenceOnS2();
ppp2 = bid2.PCurveOnSurf()->Value(bid2.LastParameter());
Standard_Real uu1 = ppp1.X(), uu2 = ppp2.X(), vv1 = ppp1.Y(), vv2 = ppp2.Y();
Standard_Real uu1 = ppp1.X(), uu2 = ppp2.X(), vv1 = ppp1.Y(), vv2 = ppp2.Y();
GeomAdaptor_Surface
gasurf((DStr.Surface(CD[pivot]->SetOfSurfData()->
Value(i[pivot][deb])->Surf())).Surface(),
uu1, uu2, vv1, vv2);
//jgv
Standard_Integer IndOfSurf = CD[pivot]->SetOfSurfData()->Value(i[pivot][deb])->IndexOfFace();
/////
GeomAbs_SurfaceType styp = gasurf.GetType();
if(styp == GeomAbs_Cylinder){
Standard_Real h = vv2 - vv1;
vv1 -= 0.5*h;
vv2 += 0.5*h;
gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
Value(i[pivot][deb])->Surf())).Surface(),
uu1, uu2, vv1, vv2);
@@ -423,6 +440,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real h = uu2 - uu1;
uu1 -= 0.1*h;
uu2 += 0.1*h;
gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
Value(i[pivot][deb])->Surf())).Surface(),
uu1, uu2, vv1, vv2);
@@ -435,11 +453,18 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(GeomAdaptor_HSurface) Surf = new GeomAdaptor_HSurface(gasurf);
// Handle(BRepTopAdaptor_TopolTool) IFac = new BRepTopAdaptor_TopolTool(Fac);
// Try to not classify on the face for cases of reentering fillets which naturally depass
// the border.
// the border.
//jgv
/*
Handle(GeomAdaptor_HSurface)
bidsurf = new GeomAdaptor_HSurface(Fac->ChangeSurface().Surface());
Handle(Adaptor3d_TopolTool)
IFac = new Adaptor3d_TopolTool(bidsurf);
*/
Handle(Adaptor3d_TopolTool) IFac = new Adaptor3d_TopolTool(Fac);
/////
// end of the attempt.
Handle(Adaptor3d_TopolTool) ISurf = new Adaptor3d_TopolTool(Surf);
Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
@@ -493,12 +518,17 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf case torus
#endif
#endif
BRepAdaptor_Surface BASpiv(FacePiv);
Handle(BRepAdaptor_HSurface) BAHSpiv = new BRepAdaptor_HSurface(BASpiv);
// Direct Construction.
// ---------------------
done = ChFiKPart_ComputeData::ComputeCorner
(DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
//(DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
(DStr,myNewFaces,myNewEdges,myFaceNewEdges,myIndsChFiFaces,
coin,Fac,BAHSpiv,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch , t_torique); // result perf case torus
@@ -591,7 +621,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
#endif
if(done && Gf2){
done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
done = CompleteData(coin,func,lin,Fac,Surf,OFac,IndOfSurf,Gd1,0,Gf1,0);
filling = !done;
}
else filling = 1;
@@ -613,7 +643,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
#endif
if(done && Gf2){
done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
done = CompleteData(coin,func,lin,Fac,Surf,OFac,IndOfSurf,Gd1,0,Gf1,0);
filling = !done;
}
else filling = 1;
@@ -744,6 +774,46 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolesp,tol2d,tolreached,0);
//jgv
Standard_Integer IndexOfCorner = coin->IndexOfFace();
Standard_Integer IndexOfE1 = coin->IndexOfEdge(1);
Standard_Integer IndexOfE2 = coin->IndexOfEdge(2);
TopoDS_Edge Bound1ofNewFace = TopoDS::Edge(myNewEdges(IndexOfE1));
TopoDS_Edge Bound2ofNewFace = TopoDS::Edge(myNewEdges(IndexOfE2));
TopoDS_Vertex VfirstOfBound1, VlastOfBound1, VfirstOfBound2, VlastOfBound2;
TopExp::Vertices(Bound1ofNewFace, VfirstOfBound1, VlastOfBound1);
TopExp::Vertices(Bound2ofNewFace, VfirstOfBound2, VlastOfBound2);
Standard_Integer IndOfCorner = coin->IndexOfFace();
const TopoDS_Face& CornerFace = TopoDS::Face(myNewFaces(IndOfCorner));
BRep_Builder BB;
TopoDS_Edge EdgeOnFaceDeb;
BB.MakeEdge(EdgeOnFaceDeb, C3d, tolreached);
BB.UpdateEdge(EdgeOnFaceDeb, corner->FirstPCurve(), CornerFace, 0.);
BB.Range(EdgeOnFaceDeb, P1deb,P2deb);
VfirstOfBound1.Orientation(TopAbs_FORWARD);
VfirstOfBound2.Orientation(TopAbs_REVERSED);
BB.Add(EdgeOnFaceDeb, VfirstOfBound1);
BB.Add(EdgeOnFaceDeb, VfirstOfBound2);
gp_Pnt2d aPnt;
gp_Vec2d aTangent;
corner->FirstPCurve()->D1(P1deb, aPnt, aTangent);
aTangent.Normalize();
Standard_Boolean IsVerticalPCurveOnEdeb = (aTangent * gp::DY2d() > 0.9);
Standard_Integer IndEdeb = myNewEdges.Add(EdgeOnFaceDeb);
if (IsVerticalPCurveOnEdeb)
IndEdeb *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfCorner).Append(IndEdeb);
IndEdeb *= -1;
if (fddeb->Orientation() != coin->Orientation())
IndEdeb *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfNewFaceDeb).Append(IndEdeb);
/////
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
regdeb.SetCurve(Icf);
@@ -764,6 +834,26 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolesp,tol2d,tolreached,0);
//jgv
TopoDS_Edge EdgeOnFaceFin;
BB.MakeEdge(EdgeOnFaceFin, C3d, tolreached);
BB.UpdateEdge(EdgeOnFaceFin, corner->LastPCurve(), CornerFace, 0.);
BB.Range(EdgeOnFaceFin, P1fin,P2fin);
VlastOfBound1.Orientation(TopAbs_FORWARD);
VlastOfBound2.Orientation(TopAbs_REVERSED);
BB.Add(EdgeOnFaceFin, VlastOfBound1);
BB.Add(EdgeOnFaceFin, VlastOfBound2);
Standard_Integer IndEfin = myNewEdges.Add(EdgeOnFaceFin);
if (!IsVerticalPCurveOnEdeb)
IndEfin *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfCorner).Append(IndEfin);
IndEfin *= -1;
if (fdfin->Orientation() != coin->Orientation())
IndEfin *= -1;
myFaceNewEdges.ChangeFromKey(IndexOfNewFaceFin).Append(IndEfin);
/////
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);
regfin.SetCurve(Icl);
@@ -796,6 +886,37 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
fddeb->ChangeVertex(isfirst,isurf2) = Pf2;
fddeb->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
fddeb->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
//jgv
Standard_Integer IndEarc1 = fddeb->IndexOfEdge(isurf1);
Standard_Integer IndEarc2 = fddeb->IndexOfEdge(isurf2);
TopoDS_Edge EdgeArc1 = TopoDS::Edge(myNewEdges(IndEarc1));
EdgeArc1.Orientation(TopAbs_FORWARD);
TopoDS_Edge EdgeArc2 = TopoDS::Edge(myNewEdges(IndEarc2));
EdgeArc2.Orientation(TopAbs_FORWARD);
Standard_Real fpar1, lpar1, fpar2, lpar2;
BRep_Tool::Range(EdgeArc1, fpar1, lpar1);
BRep_Tool::Range(EdgeArc2, fpar2, lpar2);
if (isfirst)
{
fpar1 = parpp1;
fpar2 = parpp2;
VfirstOfBound1.Orientation(TopAbs_FORWARD);
VfirstOfBound2.Orientation(TopAbs_FORWARD);
}
else
{
lpar1 = parpp1;
lpar2 = parpp2;
VfirstOfBound1.Orientation(TopAbs_REVERSED);
VfirstOfBound2.Orientation(TopAbs_REVERSED);
}
BB.Range(EdgeArc1, fpar1, lpar1);
BB.Range(EdgeArc2, fpar2, lpar2);
BB.Add(EdgeArc1, VfirstOfBound1);
BB.Add(EdgeArc2, VfirstOfBound2);
/////
TopOpeBRepDS_Curve& tcdeb = DStr.ChangeCurve(Icf);
Handle(Geom_Curve) crefdeb = tcdeb.Curve();
Standard_Real tolrdeb;
@@ -803,6 +924,9 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(fddeb->Surf()).Surface(),
P1deb,P2deb,tolesp,tolrdeb,rev);
tcdeb.Tolerance(Max(tolrdeb,tcdeb.Tolerance()));
//jgv
BB.UpdateEdge(EdgeOnFaceDeb, CD[deb]->PCurve(isfirst), FaceDeb, Max(tolrdeb,tcdeb.Tolerance()));
/////
if(rev) ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf2,*pbf1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf1,*pbf2,isfirst);
@@ -826,6 +950,36 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
fdfin->ChangeVertex(isfirst,isurf2) = Pl2;
fdfin->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
fdfin->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
//jgv
IndEarc1 = fdfin->IndexOfEdge(isurf1);
IndEarc2 = fdfin->IndexOfEdge(isurf2);
EdgeArc1 = TopoDS::Edge(myNewEdges(IndEarc1));
EdgeArc1.Orientation(TopAbs_FORWARD);
EdgeArc2 = TopoDS::Edge(myNewEdges(IndEarc2));
EdgeArc2.Orientation(TopAbs_FORWARD);
BRep_Tool::Range(EdgeArc1, fpar1, lpar1);
BRep_Tool::Range(EdgeArc2, fpar2, lpar2);
if (isfirst)
{
fpar1 = parpp1;
fpar2 = parpp2;
VlastOfBound1.Orientation(TopAbs_FORWARD);
VlastOfBound2.Orientation(TopAbs_FORWARD);
}
else
{
lpar1 = parpp1;
lpar2 = parpp2;
VlastOfBound1.Orientation(TopAbs_REVERSED);
VlastOfBound2.Orientation(TopAbs_REVERSED);
}
BB.Range(EdgeArc1, fpar1, lpar1);
BB.Range(EdgeArc2, fpar2, lpar2);
BB.Add(EdgeArc1, VlastOfBound1);
BB.Add(EdgeArc2, VlastOfBound2);
/////
TopOpeBRepDS_Curve& tcfin = DStr.ChangeCurve(Icl);
Handle(Geom_Curve) creffin = tcfin.Curve();
Standard_Real tolrfin;
@@ -833,6 +987,9 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(fdfin->Surf()).Surface(),
P1fin,P2fin,tolesp,tolrfin,rev);
tcfin.Tolerance(Max(tolrfin,tcfin.Tolerance()));
//jgv
BB.UpdateEdge(EdgeOnFaceFin, CD[fin]->PCurve(isfirst), FaceFin, Max(tolrfin,tcfin.Tolerance()));
/////
if(rev) ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl2,*pbl1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl1,*pbl2,isfirst);
@@ -864,6 +1021,36 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
fdpiv->ChangeVertex(isfirst,isurf2) = Pl2;
fdpiv->ChangeInterference(isurf1).SetParameter(p[pivot][deb],isfirst);
fdpiv->ChangeInterference(isurf2).SetParameter(p[pivot][fin],isfirst);
//jgv
IndEarc1 = fdpiv->IndexOfEdge(isurf1);
IndEarc2 = fdpiv->IndexOfEdge(isurf2);
EdgeArc1 = TopoDS::Edge(myNewEdges(IndEarc1));
EdgeArc1.Orientation(TopAbs_FORWARD);
EdgeArc2 = TopoDS::Edge(myNewEdges(IndEarc2));
EdgeArc2.Orientation(TopAbs_FORWARD);
BRep_Tool::Range(EdgeArc1, fpar1, lpar1);
BRep_Tool::Range(EdgeArc2, fpar2, lpar2);
if (isfirst)
{
fpar1 = p[pivot][deb]; //parpp1;
fpar2 = p[pivot][fin]; //parpp2;
VfirstOfBound2.Orientation(TopAbs_FORWARD);
VlastOfBound2.Orientation(TopAbs_FORWARD);
}
else
{
lpar1 = p[pivot][deb]; //parpp1;
lpar2 = p[pivot][fin]; //parpp2;
VfirstOfBound2.Orientation(TopAbs_REVERSED);
VlastOfBound2.Orientation(TopAbs_REVERSED);
}
BB.Range(EdgeArc1, fpar1, lpar1);
BB.Range(EdgeArc2, fpar2, lpar2);
BB.Add(EdgeArc1, VfirstOfBound2);
BB.Add(EdgeArc2, VlastOfBound2);
/////
CD[pivot]->InDS(isfirst); // filDS already does it from the corner.
if(rev) ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbl2,*pbf2,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbf2,*pbl2,isfirst);

View File

@@ -24,9 +24,11 @@
IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_SurfData,Standard_Transient)
ChFiDS_SurfData::ChFiDS_SurfData () :
indexOfS1(0),indexOfS2(0),indexOfConge(0),
isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
ChFiDS_SurfData::ChFiDS_SurfData ()
: indexOfS1(0),indexOfS2(0),
indexOfE1(0),indexOfE2(0),
indexOfConge(0),
isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
{}
//=======================================================================
@@ -38,6 +40,8 @@ void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
{
indexOfS1 = Other->indexOfS1;
indexOfS2 = Other->indexOfS2;
indexOfE1 = Other->indexOfE1;
indexOfE2 = Other->indexOfE2;
indexOfConge = Other->indexOfConge;
orientation = Other->orientation;
intf1 = Other->intf1;
@@ -75,6 +79,19 @@ Standard_Integer ChFiDS_SurfData::Index(const Standard_Integer OfS) const
else return indexOfS2;
}
//=======================================================================
//function : IndexOfEdge
//purpose :
//=======================================================================
inline Standard_Integer ChFiDS_SurfData::IndexOfEdge(const Standard_Integer OnS) const
{
if (OnS == 1)
return indexOfE1;
else
return indexOfE2;
}
//=======================================================================
//function : Interference
//purpose :
@@ -87,9 +104,8 @@ const ChFiDS_FaceInterference& ChFiDS_SurfData::Interference
else return intf2;
}
//=======================================================================
//function : Interference
//function : ChangeInterference
//purpose :
//=======================================================================

View File

@@ -81,6 +81,12 @@ public:
void ChangeIndexOfS2 (const Standard_Integer Index);
void ChangeIndexOfFace (const Standard_Integer Index);
void ChangeIndexOfE1 (const Standard_Integer Index);
void ChangeIndexOfE2 (const Standard_Integer Index);
void ChangeSurf (const Standard_Integer Index);
void SetIndexOfC1 (const Standard_Integer Index);
@@ -105,8 +111,12 @@ public:
Standard_EXPORT ChFiDS_FaceInterference& ChangeInterference (const Standard_Integer OnS);
Standard_EXPORT Standard_Integer IndexOfFace () const;
Standard_EXPORT Standard_Integer Index (const Standard_Integer OfS) const;
Standard_EXPORT Standard_Integer IndexOfEdge(const Standard_Integer OfS) const;
//! returns one of the four vertices wether First is true
//! or wrong and OnS equals 1 or 2.
Standard_EXPORT const ChFiDS_CommonPoint& Vertex (const Standard_Boolean First, const Standard_Integer OnS) const;
@@ -187,7 +197,11 @@ private:
Standard_Integer indexOfC1;
Standard_Integer indexOfS2;
Standard_Integer indexOfC2;
Standard_Integer indexOfE1;
Standard_Integer indexOfE2;
Standard_Integer indexOfFace;
Standard_Integer indexOfConge;
Standard_Boolean isoncurv1;
Standard_Boolean isoncurv2;
Standard_Boolean twistons1;

View File

@@ -98,6 +98,16 @@ inline void ChFiDS_SurfData::SetIndexOfC2 (const Standard_Integer theIndex)
isoncurv2 = (theIndex != 0);
}
//=======================================================================
//function : IndexOfFace
//purpose :
//=======================================================================
inline Standard_Integer ChFiDS_SurfData::IndexOfFace()const
{
return indexOfFace;
}
//=======================================================================
//function : Surf
//purpose :
@@ -201,6 +211,36 @@ inline void ChFiDS_SurfData::ChangeIndexOfS2(const Standard_Integer Index)
indexOfS2 = Index;
}
//=======================================================================
//function : ChangeIndexOfFace
//purpose :
//=======================================================================
inline void ChFiDS_SurfData::ChangeIndexOfFace(const Standard_Integer Index)
{
indexOfFace = Index;
}
//=======================================================================
//function : ChangeIndexOfE1
//purpose :
//=======================================================================
inline void ChFiDS_SurfData::ChangeIndexOfE1(const Standard_Integer Index)
{
indexOfE1 = Index;
}
//=======================================================================
//function : ChangeIndexOfE2
//purpose :
//=======================================================================
inline void ChFiDS_SurfData::ChangeIndexOfE2(const Standard_Integer Index)
{
indexOfE2 = Index;
}
//=======================================================================
//function : ChangeSurf
//purpose :

View File

@@ -82,6 +82,10 @@
#include <TopOpeBRepDS_Curve.hxx>
#include <TopOpeBRepDS_DataStructure.hxx>
#include <TopOpeBRepDS_Surface.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib_MakeVertex.hxx>
//#include <BRepAdaptor_Curve2d.hxx>
//#include <BRepAdaptor_HCurve2d.hxx>
@@ -91,9 +95,15 @@
//=======================================================================
Standard_Boolean ChFiKPart_ComputeData::Compute
(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
Handle(ChFiDS_SurfData)& Data,
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
//const Handle(Adaptor3d_HSurface)& S1,
//const Handle(Adaptor3d_HSurface)& S2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Handle(ChFiDS_Spine)& Sp,
@@ -115,15 +125,16 @@
// Return orientations.
TopAbs_Orientation OrFace1 = TopAbs_FORWARD, OrFace2 = TopAbs_FORWARD;
Handle(BRepAdaptor_HSurface) HS = Handle(BRepAdaptor_HSurface)::DownCast(S1);
if (!HS.IsNull()) OrFace1 = HS->ChangeSurface().Face().Orientation();
HS = Handle(BRepAdaptor_HSurface)::DownCast(S2);
if (!HS.IsNull()) OrFace2 = HS->ChangeSurface().Face().Orientation();
//Handle(BRepAdaptor_HSurface) HS = Handle(BRepAdaptor_HSurface)::DownCast(S1);
OrFace1 = S1->ChangeSurface().Face().Orientation();
//HS = Handle(BRepAdaptor_HSurface)::DownCast(S2);
OrFace2 = S2->ChangeSurface().Face().Orientation();
if(!Spine.IsNull()){
Standard_Real Radius = Spine->Radius(Iedge);
if ( typ1 == GeomAbs_Plane && typ2 == GeomAbs_Plane ){
surfok = ChFiKPart_MakeFillet(DStr,Data,S1->Plane(),S2->Plane(),
surfok = ChFiKPart_MakeFillet(DStr,theNewFaces,theNewEdges,theFaceNewEdges,theIndsChFiFaces,
Data,S1,S2,
Or1,Or2,Radius,Spine->Line(),
Wref,OrFace1);
}
@@ -134,7 +145,8 @@
Or1,Or2,Radius,Spine->Line(),
Wref,OrFace1,Standard_True);
else
surfok = ChFiKPart_MakeFillet(DStr,Data,S1->Plane(),S2->Cylinder(),
surfok = ChFiKPart_MakeFillet(DStr,theNewFaces,theNewEdges,theFaceNewEdges,theIndsChFiFaces,
Data,S1,S2,
S2->FirstUParameter(),S2->LastUParameter(),
Or1,Or2,Radius,Spine->Circle(),
Wref,OrFace1,Standard_True);
@@ -146,7 +158,8 @@
Or2,Or1,Radius,Spine->Line(),
Wref,OrFace2,Standard_False);
else
surfok = ChFiKPart_MakeFillet(DStr,Data,S2->Plane(),S1->Cylinder(),
surfok = ChFiKPart_MakeFillet(DStr,theNewFaces,theNewEdges,theFaceNewEdges,theIndsChFiFaces,
Data,S2,S1,
S1->FirstUParameter(),S1->LastUParameter(),
Or2,Or1,Radius,Spine->Circle(),
Wref,OrFace2,Standard_False);
@@ -342,9 +355,15 @@
Standard_Boolean ChFiKPart_ComputeData::ComputeCorner
(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
//const Handle(Adaptor3d_HSurface)& S1,
//const Handle(Adaptor3d_HSurface)& S2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation OrFace1,
const TopAbs_Orientation,
const TopAbs_Orientation Or1,
@@ -378,9 +397,10 @@ Standard_Boolean ChFiKPart_ComputeData::ComputeCorner
fu = First;
lu = Last;
}
surfok = ChFiKPart_MakeFillet(DStr,Data,S1->Plane(),cyl,
fu,lu,Or1,Or2,minRad,circ,
First,OrFace1,Standard_True);
surfok = ChFiKPart_MakeFillet(DStr,theNewFaces,theNewEdges,theFaceNewEdges,theIndsChFiFaces,
Data,S1,S2,/*S1->Plane(),cyl,*/
fu,lu,Or1,Or2,minRad,circ,
First,OrFace1,Standard_True);
if(surfok){
if ( typ2 != GeomAbs_Cylinder ){
Data->ChangeInterferenceOnS2().ChangePCurveOnFace() =
@@ -394,6 +414,36 @@ Standard_Boolean ChFiKPart_ComputeData::ComputeCorner
Data->ChangeInterferenceOnS1().SetLastParameter(Last);
Data->ChangeInterferenceOnS2().SetFirstParameter(First);
Data->ChangeInterferenceOnS2().SetLastParameter(Last);
//jgv
Standard_Integer IndexOfE1 = Data->IndexOfEdge(1);
Standard_Integer IndexOfE2 = Data->IndexOfEdge(2);
TopoDS_Edge Bound1 = TopoDS::Edge(theNewEdges(IndexOfE1));
TopoDS_Edge Bound2 = TopoDS::Edge(theNewEdges(IndexOfE2));
BRep_Builder BB;
BB.Range(Bound1, First, Last);
BB.Range(Bound2, First, Last);
if (!BRep_Tool::Degenerated(Bound1))
{
BRepAdaptor_Curve BAcurve(Bound1);
gp_Pnt aPnt = BAcurve.Value(First);
TopoDS_Vertex V1 = BRepLib_MakeVertex(aPnt);
BB.Add(Bound1, V1);
aPnt = BAcurve.Value(Last);
TopoDS_Vertex V2 = BRepLib_MakeVertex(aPnt);
V2.Reverse();
BB.Add(Bound1, V2);
}
BRepAdaptor_Curve BAcurve(Bound2);
gp_Pnt aPnt = BAcurve.Value(First);
TopoDS_Vertex V1 = BRepLib_MakeVertex(aPnt);
BB.Add(Bound2, V1);
aPnt = BAcurve.Value(Last);
TopoDS_Vertex V2 = BRepLib_MakeVertex(aPnt);
V2.Reverse();
BB.Add(Bound2, V2);
/////
return Standard_True;
}
return Standard_False;

View File

@@ -25,9 +25,16 @@
#include <TopAbs_Orientation.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
class TopOpeBRepDS_DataStructure;
class ChFiDS_SurfData;
class Adaptor3d_HSurface;
class BRepAdaptor_HSurface;
class ChFiDS_Spine;
class gp_Pnt2d;
@@ -49,16 +56,68 @@ public:
//! Computes a simple fillet in several particular
//! cases.
Standard_EXPORT static Standard_Boolean Compute (TopOpeBRepDS_DataStructure& DStr, Handle(ChFiDS_SurfData)& Data, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const TopAbs_Orientation Or1, const TopAbs_Orientation Or2, const Handle(ChFiDS_Spine)& Sp, const Standard_Integer Iedge);
Standard_EXPORT static Standard_Boolean Compute (TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
Handle(ChFiDS_SurfData)& Data,
//const Handle(Adaptor3d_HSurface)& S1,
//const Handle(Adaptor3d_HSurface)& S2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Handle(ChFiDS_Spine)& Sp,
const Standard_Integer Iedge);
//! Computes a toric or spheric corner fillet.
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr, const Handle(ChFiDS_SurfData)& Data, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const TopAbs_Orientation OrFace1, const TopAbs_Orientation OrFace2, const TopAbs_Orientation Or1, const TopAbs_Orientation Or2, const Standard_Real minRad, const Standard_Real majRad, const gp_Pnt2d& P1S1, const gp_Pnt2d& P2S1, const gp_Pnt2d& P1S2, const gp_Pnt2d& P2S2);
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
//const Handle(Adaptor3d_HSurface)& S1,
//const Handle(Adaptor3d_HSurface)& S2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation OrFace1,
const TopAbs_Orientation OrFace2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Standard_Real minRad,
const Standard_Real majRad,
const gp_Pnt2d& P1S1,
const gp_Pnt2d& P2S1,
const gp_Pnt2d& P1S2,
const gp_Pnt2d& P2S2);
//! Computes spheric corner fillet with non iso pcurve on S2.
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr, const Handle(ChFiDS_SurfData)& Data, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const TopAbs_Orientation OrFace1, const TopAbs_Orientation OrFace2, const TopAbs_Orientation Or1, const TopAbs_Orientation Or2, const Standard_Real Rad, const gp_Pnt2d& PS1, const gp_Pnt2d& P1S2, const gp_Pnt2d& P2S2);
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr,
const Handle(ChFiDS_SurfData)& Data,
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation OrFace1,
const TopAbs_Orientation OrFace2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Standard_Real Rad,
const gp_Pnt2d& PS1,
const gp_Pnt2d& P1S2,
const gp_Pnt2d& P2S2);
//! Computes a toric corner rotule.
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr, const Handle(ChFiDS_SurfData)& Data, const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const TopAbs_Orientation OfS, const TopAbs_Orientation OS, const TopAbs_Orientation OS1, const TopAbs_Orientation OS2, const Standard_Real Radius);
Standard_EXPORT static Standard_Boolean ComputeCorner (TopOpeBRepDS_DataStructure& DStr,
const Handle(ChFiDS_SurfData)& Data,
const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_HSurface)& S2,
const TopAbs_Orientation OfS,
const TopAbs_Orientation OS,
const TopAbs_Orientation OS1,
const TopAbs_Orientation OS2,
const Standard_Real Radius);

View File

@@ -45,6 +45,9 @@
#include <IntAna_QuadQuadGeo.hxx>
#include <Precision.hxx>
#include <TopOpeBRepDS_DataStructure.hxx>
#include <BRepAdaptor_HSurface.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib_MakeVertex.hxx>
//=======================================================================
//function : MakeFillet
@@ -224,19 +227,50 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
//=======================================================================
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
const gp_Pln& Pln,
const gp_Cylinder& Cyl,
//const gp_Pln& Pln,
//const gp_Cylinder& Cyl,
const Handle(BRepAdaptor_HSurface)& Spln,
const Handle(BRepAdaptor_HSurface)& Scyl,
const Standard_Real fu,
const Standard_Real lu,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Standard_Real Radius,
const gp_Circ& Spine,
const Standard_Real First,
const Standard_Real First,
const TopAbs_Orientation Ofpl,
const Standard_Boolean plandab)
{
Standard_Integer IndFpln, IndFcyl;
const TopoDS_Face& FacePln = Spln->ChangeSurface().Face();
const TopoDS_Face& FaceCyl = Scyl->ChangeSurface().Face();
if (!theNewFaces.Contains(FacePln))
theNewFaces.Add(FacePln);
IndFpln = theNewFaces.FindIndex(FacePln);
if (!theFaceNewEdges.Contains(IndFpln))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndFpln, aList);
}
if (!theNewFaces.Contains(FaceCyl))
theNewFaces.Add(FaceCyl);
IndFcyl = theNewFaces.FindIndex(FaceCyl);
if (!theFaceNewEdges.Contains(IndFcyl))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndFcyl, aList);
}
gp_Pln Pln = Spln->Plane();
gp_Cylinder Cyl = Scyl->Cylinder();
//calculation of the fillet (torus or sphere).
Standard_Boolean c1sphere = Standard_False;
@@ -306,16 +340,15 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
gp_Ax3 FilAx3(Or,Dz,Dx);
if (FilAx3.YDirection().Dot(Dy) <= 0.){ FilAx3.YReverse(); }
if(c1sphere) {
Handle(Geom_SphericalSurface)
gsph = new Geom_SphericalSurface(FilAx3,Radius);
Data->ChangeSurf(ChFiKPart_IndexSurfaceInDS(gsph,DStr));
}
else{
Handle(Geom_ToroidalSurface)
gtor = new Geom_ToroidalSurface(FilAx3,Rad,Radius);
Data->ChangeSurf(ChFiKPart_IndexSurfaceInDS(gtor,DStr));
}
Handle(Geom_Surface) NewSurf;
if(c1sphere)
NewSurf = new Geom_SphericalSurface(FilAx3,Radius);
else
NewSurf = new Geom_ToroidalSurface(FilAx3,Rad,Radius);
Data->ChangeSurf(ChFiKPart_IndexSurfaceInDS(NewSurf, DStr));
// It is checked if the orientation of the fillet is the same as of faces.
gp_Pnt P,PP;
@@ -451,6 +484,66 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
SetInterference(ChFiKPart_IndexCurveInDS(GCircCyl,DStr),
trans,GLin2dCyl,GLin2dFil2);
}
//Add new face and its new edges in the maps
BRep_Builder BB;
TopLoc_Location aLoc;
TopoDS_Face aNewFace;
BB.MakeFace(aNewFace);
BB.UpdateFace(aNewFace, NewSurf, aLoc, Precision::Confusion());
aNewFace.Orientation(Data->Orientation());
Standard_Integer IndNewFace = theNewFaces.Add(aNewFace);
theIndsChFiFaces.Add(IndNewFace);
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndNewFace, aList);
Data->ChangeIndexOfFace(IndNewFace);
TopoDS_Edge Boundary1, Boundary2;
BB.MakeEdge(Boundary1);
BB.UpdateEdge(Boundary1, GLin2dFil1, aNewFace, 0.);
if (GCircPln.IsNull())
{
BB.Degenerated(Boundary1, Standard_True);
gp_Pnt2d aPnt2d = GLin2dFil1->Value(First);
gp_Pnt aPnt = NewSurf->Value(aPnt2d.X(), aPnt2d.Y());
TopoDS_Vertex aVertex = BRepLib_MakeVertex(aPnt);
BB.Add(Boundary1, aVertex);
aVertex.Reverse();
BB.Add(Boundary1, aVertex);
}
else
{
BB.UpdateEdge(Boundary1, GCircPln, 0.);
BB.UpdateEdge(Boundary1, GCirc2dPln, FacePln, 0.);
}
theNewEdges.Add(Boundary1);
Standard_Integer IndE1 = theNewEdges.FindIndex(Boundary1);
Data->ChangeIndexOfE1(IndE1);
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE1);
if (!GCircPln.IsNull()) //<Boundary1> is not degenerated
{
IndE1 *= -1;
if (Data->Orientation() != FacePln.Orientation())
IndE1 *= -1;
theFaceNewEdges.ChangeFromKey(IndFpln).Append(IndE1);
}
BB.MakeEdge(Boundary2);
BB.UpdateEdge(Boundary2, GCircCyl, 0.);
BB.UpdateEdge(Boundary2, GLin2dCyl, FaceCyl, 0.);
BB.UpdateEdge(Boundary2, GLin2dFil2, aNewFace, 0.);
theNewEdges.Add(Boundary2);
Standard_Integer IndE2 = theNewEdges.FindIndex(Boundary2);
Data->ChangeIndexOfE2(IndE2);
IndE2 *= -1;
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE2);
IndE2 *= -1;
if (Data->Orientation() != FaceCyl.Orientation())
IndE2 *= -1;
theFaceNewEdges.ChangeFromKey(IndFcyl).Append(IndE2);
return Standard_True;
}

View File

@@ -32,9 +32,15 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
const Standard_Boolean plandab);
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
const gp_Pln& Pln,
const gp_Cylinder& Cyl,
//const gp_Pln& Pln,
//const gp_Cylinder& Cyl,
const Handle(BRepAdaptor_HSurface)& Spln,
const Handle(BRepAdaptor_HSurface)& Scyl,
const Standard_Real fu,
const Standard_Real lu,
const TopAbs_Orientation Or1,

View File

@@ -15,7 +15,8 @@
// commercial license or contractual agreement.
#include <Adaptor3d_HSurface.hxx>
//#include <Adaptor3d_HSurface.hxx>
#include <BRepAdaptor_HSurface.hxx>
#include <ChFiDS_Spine.hxx>
#include <ChFiDS_SurfData.hxx>
#include <ChFiKPart_ComputeData.hxx>
@@ -40,15 +41,25 @@
#include <IntAna_QuadQuadGeo.hxx>
#include <Precision.hxx>
#include <TopOpeBRepDS_DataStructure.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib_MakeEdge.hxx>
//=======================================================================
//function : MakeFillet
//Purpose : cas plan/plan.
//=======================================================================
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
const gp_Pln& Pl1,
const gp_Pln& Pl2,
//const gp_Pln& Pl1,
//const gp_Pln& Pl2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Standard_Real Radius,
@@ -56,6 +67,31 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
const Standard_Real First,
const TopAbs_Orientation Of1)
{
Standard_Integer IndF1, IndF2;
const TopoDS_Face& F1 = S1->ChangeSurface().Face();
const TopoDS_Face& F2 = S2->ChangeSurface().Face();
if (!theNewFaces.Contains(F1))
theNewFaces.Add(F1);
IndF1 = theNewFaces.FindIndex(F1);
if (!theFaceNewEdges.Contains(IndF1))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndF1, aList);
}
if (!theNewFaces.Contains(F2))
theNewFaces.Add(F2);
IndF2 = theNewFaces.FindIndex(F2);
if (!theFaceNewEdges.Contains(IndF2))
{
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndF2, aList);
}
gp_Pln Pl1 = S1->Plane();
gp_Pln Pl2 = S2->Plane();
//calcul du cylindre
gp_Ax3 Pos1 = Pl1.Position();
@@ -146,6 +182,77 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
Data->ChangeInterferenceOnS2().
SetInterference(ChFiKPart_IndexCurveInDS(GLinPln2,DStr),
trans,GLin2dPln2,GLin2dCyl2);
//Add new face and its new edges in the maps
BRep_Builder BB;
TopLoc_Location aLoc;
TopoDS_Face aNewFace;
BB.MakeFace(aNewFace);
BB.UpdateFace(aNewFace, gcyl, aLoc, Precision::Confusion());
aNewFace.Orientation(Data->Orientation());
Standard_Integer IndNewFace = theNewFaces.Add(aNewFace);
theIndsChFiFaces.Add(IndNewFace);
//ChFi3d_ListOfQualifiedEdge aList;
TColStd_ListOfInteger aList;
theFaceNewEdges.Add(IndNewFace, aList);
Data->ChangeIndexOfFace(IndNewFace);
TopoDS_Edge Boundary1, Boundary2;
Boundary1 = BRepLib_MakeEdge(GLinPln1);
BB.UpdateEdge(Boundary1, GLin2dPln1, F1, 0.);
BB.UpdateEdge(Boundary1, GLin2dCyl1, aNewFace, 0.);
theNewEdges.Add(Boundary1);
/*
Standard_Integer IndE1 = theNewEdges.FindIndex(Boundary1);
Data->ChangeIndexOfE1(IndE1);
//QualifiedEdge aQE1(IndE1, Et);
if (Data->Orientation() == TopAbs_REVERSED)
IndE1 *= -1;
theFaceNewEdges.ChangeFromKey(IndF1).Append(IndE1);
Standard_Integer IndE1_forNewFace = IndE1;
if (Data->Orientation() == TopAbs_FORWARD)
IndE1_forNewFace *= -1;
//theFaceNewEdges.ChangeFromKey(IndNewFace).Append(-IndE1);
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE1_forNewFace);
*/
Standard_Integer IndE1 = theNewEdges.FindIndex(Boundary1);
Data->ChangeIndexOfE1(IndE1);
IndE1 *= -1;
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE1);
IndE1 *= -1;
if (Data->Orientation() != F1.Orientation())
IndE1 *= -1;
theFaceNewEdges.ChangeFromKey(IndF1).Append(IndE1);
Boundary2 = BRepLib_MakeEdge(GLinPln2);
BB.UpdateEdge(Boundary2, GLin2dPln2, F2, 0.);
BB.UpdateEdge(Boundary2, GLin2dCyl2, aNewFace, 0.);
theNewEdges.Add(Boundary2);
/*
Standard_Integer IndE2 = theNewEdges.FindIndex(Boundary2);
Data->ChangeIndexOfE2(IndE2);
IndE2 *= -1;
if (Data->Orientation() == TopAbs_REVERSED)
IndE2 *= -1;
theFaceNewEdges.ChangeFromKey(IndF2).Append(IndE2);
Standard_Integer IndE2_forNewFace = IndE2;
if (Data->Orientation() == TopAbs_FORWARD)
IndE2_forNewFace *= -1;
//theFaceNewEdges.ChangeFromKey(IndNewFace).Append(-IndE2);
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE2_forNewFace);
*/
Standard_Integer IndE2 = theNewEdges.FindIndex(Boundary2);
Data->ChangeIndexOfE2(IndE2);
theFaceNewEdges.ChangeFromKey(IndNewFace).Append(IndE2);
IndE2 *= -1;
if (Data->Orientation() != F2.Orientation())
IndE2 *= -1;
theFaceNewEdges.ChangeFromKey(IndF2).Append(IndE2);
return Standard_True;
}

View File

@@ -18,9 +18,15 @@
#define ChFiKPart_ComputeData_PlnPln_HeaderFile
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
TopTools_IndexedMapOfShape& theNewFaces,
TopTools_IndexedMapOfShape& theNewEdges,
NCollection_IndexedDataMap<Standard_Integer, TColStd_ListOfInteger>& theFaceNewEdges,
TColStd_MapOfInteger& theIndsChFiFaces,
const Handle(ChFiDS_SurfData)& Data,
const gp_Pln& Pl1,
const gp_Pln& Pl2,
//const gp_Pln& Pl1,
//const gp_Pln& Pl2,
const Handle(BRepAdaptor_HSurface)& S1,
const Handle(BRepAdaptor_HSurface)& S2,
const TopAbs_Orientation Or1,
const TopAbs_Orientation Or2,
const Standard_Real Radius,

View File

@@ -299,7 +299,7 @@ void Draw_Interpretor::SetToColorize (Standard_Boolean theToColorize)
{
if (Handle(Message_PrinterOStream) aPrinter = Handle(Message_PrinterOStream)::DownCast (aPrinterIter.Value()))
{
aPrinter->SetToColorize (theToColorize);
aPrinter->SetToColorize (Standard_False);
}
}
}

View File

@@ -42,6 +42,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -108,7 +109,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
{
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (pt1.X(), pt1.Y(), pt1.Z());
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
break;
}
@@ -118,7 +119,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
// On dessine un rond
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (pt2.X(), pt2.Y(), pt2.Z());
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
break;
}

View File

@@ -161,7 +161,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(12);
for( i = 0; i <= 11; i++ )
aPrims->AddVertex(ElCLib::Value(param + angle/11 * i, aCircle2));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
DsgPrs::ComputeSymbol(aPresentation, aDimensionAspect, AttachmentPnt,
AttachmentPnt, aDir, aDir, DsgPrs_AS_LASTAR);
@@ -171,7 +171,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
param = ElCLib::Parameter(aCircle2, tmpPnt);
tmpPnt = ElCLib::Value(param, aCircle2);
tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2));
Prs3d_Text::Draw (aPresentation->CurrentGroup(), aDimensionAspect->TextAspect(), txt, tmpPnt);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), aDimensionAspect->TextAspect(), txt, tmpPnt);
angle = 2. * M_PI - param ;
if( param > OppParam )
@@ -180,7 +180,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
aPrims = new Graphic3d_ArrayOfPolylines(12);
for( i = 11; i >= 0; i-- )
aPrims->AddVertex(ElCLib::Value(-angle/11 * i, aCircle2));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
if( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 1 && !IsConeTrimmed ) //above
@@ -204,7 +204,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
aPrims->AddVertex(OppositePnt);
aPrims->AddVertex(( aPnt.Distance(P1) < aPnt.Distance(P2) )? P11 : P12);
}
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
@@ -230,7 +230,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
sprintf(valcar,"%5.2f",theval);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
Handle(Graphic3d_Group) aGroup = aPresentation->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
aGroup->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Ax2 ax(CenterPoint,axisdir,dir1);
@@ -343,7 +343,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
sprintf(valcar,"%5.2f",theval);
Handle( Prs3d_DimensionAspect ) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
gp_Circ AngleCirc, AttachCirc;
Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc;
@@ -385,7 +385,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
for (Standard_Integer i = 0; i < NodeNumber; i++, FirstParAngleCirc += delta)
aPrims->AddVertex(ElCLib::Value( FirstParAngleCirc, AngleCirc ));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
aPrims = new Graphic3d_ArrayOfSegments(4);
}
else // null angle
@@ -399,7 +399,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow2, ArrowPrs );
// Drawing the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint);
// Line from AttachmentPoint1 to end of Arrow1
aPrims->AddVertex(AttachmentPoint1);
@@ -408,7 +408,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
aPrims->AddVertex(ProjAttachPoint2);
aPrims->AddVertex(EndOfArrow2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// Line or arc from AttachmentPoint2 to its "projection"
if (AttachmentPoint2.Distance( ProjAttachPoint2 ) > Precision::Confusion())
@@ -431,7 +431,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
for (Standard_Integer i = 0; i < NodeNumber; i++, FirstParAttachCirc += delta)
aPrims->AddVertex(ElCLib::Value( FirstParAttachCirc, AttachCirc ));
}
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}
@@ -457,7 +457,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
sprintf(valcar,"%5.2f",theval);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir Norm;
if (!dir1.IsParallel(dir2, Precision::Angular())) {
@@ -515,7 +515,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText,OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText,OffsetPoint);
Standard_Real length = LA->ArrowAspect()->Length();
if (length < Precision::Confusion()) length = 1.e-04;
@@ -534,7 +534,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
gp_Vec v2(ptarr,ptarr3);
const Standard_Real beta = v1.Angle(v2);
dirarr.Rotate(ax1, beta);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, dirarr, LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr, LA->ArrowAspect()->Angle(), length);
aPrims->AddBound(2);
aPrims->AddVertex(AttachmentPoint1);
@@ -545,13 +545,13 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
ax1.SetLocation(ptarr);
gp_Dir dirarr2(vecarr);
dirarr2.Rotate(ax1, - beta);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length);
aPrims->AddBound(2);
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(ptarr);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
@@ -576,7 +576,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
sprintf(valcar,"%5.2f",theval);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir Norm = dir1.Crossed(dir2);
if (Abs(theval) > M_PI) Norm.Reverse();
@@ -626,7 +626,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint);
Standard_Real length = LA->ArrowAspect()->Length();
if (length < Precision::Confusion()) length = 1.e-04;
@@ -662,7 +662,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(ptarr1);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// One traces the arrows
DsgPrs::ComputeSymbol(aPresentation,LA,ptarr,ptarr1,dirarr,dirarr2,ArrowPrs);
@@ -692,7 +692,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
TCollection_ExtendedString aText(valas);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir Norm = dir1.Crossed(dir2);
if (Abs(theval) > M_PI) Norm.Reverse();
@@ -742,7 +742,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint);
Standard_Real length = LA->ArrowAspect()->Length();
if (length < Precision::Confusion()) length = 1.e-04;
@@ -762,7 +762,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
const Standard_Real beta = v1.Angle(v2);
dirarr.Rotate(ax1, beta);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, dirarr, LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr, LA->ArrowAspect()->Angle(), length);
aPrims->AddBound(2);
aPrims->AddVertex(AttachmentPoint1);
@@ -773,13 +773,13 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
gp_Dir dirarr2(vecarr);
dirarr2.Rotate(ax1, -beta);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length);
aPrims->AddBound(2);
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(ptarr);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
@@ -791,7 +791,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
const DsgPrs_ArrowSide ArrowSide)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir dir1(gp_Vec(CenterPoint, AttachmentPoint1));
gp_Ax2 ax(CenterPoint,theAxe.Direction(),dir1);
@@ -803,7 +803,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(dteta*(i-1),cer));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
Standard_Real uc1 = 0.;
Standard_Real uc2 = ElCLib::Parameter(cer,AttachmentPoint1.Rotated(theAxe,theval));
@@ -818,21 +818,21 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
case DsgPrs_AS_FIRSTAR:
{
ElCLib::D1(uc1,cer,ptarr,vecarr);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, gp_Dir(-vecarr), LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(-vecarr), LA->ArrowAspect()->Angle(), length);
break;
}
case DsgPrs_AS_LASTAR:
{
ElCLib::D1(uc2,cer,ptarr,vecarr);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length);
break;
}
case DsgPrs_AS_BOTHAR:
{
ElCLib::D1(uc1,cer,ptarr,vecarr);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, gp_Dir(-vecarr), LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(-vecarr), LA->ArrowAspect()->Angle(), length);
ElCLib::D1(uc2,cer,ptarr,vecarr);
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length);
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length);
break;
}
default: break;

View File

@@ -38,17 +38,17 @@ void DsgPrs_Chamf2dPresentation::Add(
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(aPntAttach);
aPrims->AddVertex(aPntEnd);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), aPntAttach, ArrowDir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), aPntAttach, ArrowDir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntEnd);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntEnd);
}
@@ -67,14 +67,14 @@ void DsgPrs_Chamf2dPresentation::Add(
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(aPntAttach);
aPrims->AddVertex(aPntEnd);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntEnd);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntEnd);
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
gp_Dir ArrowDir1 = ArrowDir;

View File

@@ -14,6 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <DsgPrs_ConcentricPresentation.hxx>
#include <ElCLib.hxx>
#include <gp_Circ.hxx>
@@ -25,6 +26,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
void DsgPrs_ConcentricPresentation::Add(
const Handle(Prs3d_Presentation)& aPresentation,
@@ -41,7 +43,7 @@ void DsgPrs_ConcentricPresentation::Add(
const Standard_Integer nbp = 50;
const Standard_Real dteta = (2. * M_PI)/nbp;
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(2*nbp+6,4);
@@ -88,5 +90,5 @@ void DsgPrs_ConcentricPresentation::Add(
aPrims->AddVertex(p1);
aPrims->AddVertex(p2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}

View File

@@ -34,7 +34,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
const Handle(Prs3d_Drawer)& theDrawer)
{
Handle(Prs3d_DatumAspect) aDatumAspect = theDrawer->DatumAspect();
Handle(Graphic3d_Group) aGroup = thePresentation->CurrentGroup();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
gp_Ax2 anAxis (theDatum);
gp_Pnt anOrigin = anAxis.Location();

View File

@@ -48,7 +48,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
const Standard_Boolean IsDiamSymbol )
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Standard_Real parat = ElCLib::Parameter(aCircle, AttachmentPoint);
gp_Pnt ptoncirc = ElCLib::Value (parat, aCircle);
@@ -73,13 +73,13 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(pt1);
aPrims->AddVertex(OppositePoint);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// value
TCollection_ExtendedString Text = aText;
if(IsDiamSymbol)
Text = TCollection_ExtendedString("\330 ") + aText; // VRO (2007-05-17) inserted a blank.
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), Text, AttachmentPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, AttachmentPoint);
// arrows
gp_Dir arrdir (vecrap);
@@ -144,7 +144,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
}
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Standard_Real parEndOfArrow = ElCLib::Parameter(aCircle,AttachmentPoint);
gp_Pnt EndOfArrow;
gp_Pnt DrawPosition = AttachmentPoint;// point of attachment
@@ -185,13 +185,13 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(DrawPosition);
aPrims->AddVertex(EndOfArrow);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// text
TCollection_ExtendedString Text = aText;
if(IsDiamSymbol)
Text = TCollection_ExtendedString("\330 ") + Text;// => \330 | \370?
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), Text, DrawPosition);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, DrawPosition);
// Add presentation of arrow
gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ());

View File

@@ -57,7 +57,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
const DsgPrs_ArrowSide ArrowPrs)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
const Standard_Real dist = aCenter.Distance( aPosition );
const Standard_Boolean inside = ( dist <= theval );
@@ -66,12 +66,12 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(aCenter);
aPrims->AddVertex(EndPoint);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// value
TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = ");
Text += aText;
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), Text, aPosition);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, aPosition);
// arrows
gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
@@ -99,7 +99,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
const DsgPrs_ArrowSide ArrowPrs)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
if(!IsInDomain)
{
@@ -115,7 +115,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
for (Standard_Integer i = 0 ; i < NodeNumber; i++, parFirst += delta)
aPrims->AddVertex(ElCLib::Value( parFirst, anEllipse ));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
@@ -141,7 +141,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
const DsgPrs_ArrowSide ArrowPrs)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
if(!IsInDomain)
{
@@ -167,7 +167,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
aCurve->D0( parFirst, p1 );
aPrims->AddVertex(p1);
}
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);

View File

@@ -32,6 +32,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -47,7 +48,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
const Handle( Geom_Plane )& Plane )
{
Handle( Prs3d_DimensionAspect ) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
// Line between two middles
gp_Pnt Middle12( (Point1.XYZ() + Point2.XYZ()) * 0.5 ), Middle34( (Point3.XYZ() + Point4.XYZ()) * 0.5 );
@@ -55,7 +56,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(Middle12);
aPrims->AddVertex(Middle34);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// Add presentation of arrows (points)
gp_Dir aDir( 0, 0, 1 );
@@ -111,7 +112,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
TCollection_ExtendedString aText("==");
//Draw the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(),LA->TextAspect(), aText, aTextPos);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),LA->TextAspect(), aText, aTextPos);
}
@@ -131,7 +132,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
gp_Pnt& aProj2)
{
const Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Lin L1 (aPoint1,aDirection);
gp_Lin L2 (aPoint2,aDirection);
@@ -143,7 +144,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
aPrims->AddVertex(aProj1);
aPrims->AddVertex(aProj2);
aPrims->AddVertex(aPoint2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
//add arrows presentation
gp_Dir aDir(aProj2.XYZ() - aProj1.XYZ());
@@ -169,7 +170,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
const DsgPrs_ArrowSide anArrowSide)
{
const Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Standard_Real aPar11, aPar12, aPar21, aPar22;
if(aCirc1.Radius() > Precision::Confusion()){
@@ -192,7 +193,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(aPoint2);
aPrims->AddVertex(aPoint4);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
Standard_Integer i, aNodeNb;
Standard_Real aDelta, aCurPar;
@@ -207,7 +208,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc1));
aPrims->AddVertex(aPoint2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
if (aPar22 < aPar21) aPar22 += 2.*M_PI;
if ( Abs(aPar22 - aPar21) > Precision::Confusion())
@@ -220,7 +221,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc2));
aPrims->AddVertex(aPoint4);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
//get the direction of interval

View File

@@ -29,6 +29,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -41,14 +42,14 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
const Handle( Geom_Plane )& Plane )
{
Handle( Prs3d_DimensionAspect ) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
aPrims->AddVertex(FirstPoint);
aPrims->AddVertex(FirstCenter);
aPrims->AddVertex(SecondCenter);
aPrims->AddVertex(SecondPoint);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// Add presentation of arrows
gp_Dir FirstDir = gce_MakeDir( FirstCenter, FirstPoint ), SecondDir = gce_MakeDir( SecondCenter, SecondPoint );
@@ -90,6 +91,6 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
}
//Draw the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aTextPos);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aTextPos);
//ota === end ===
}

View File

@@ -71,7 +71,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
gp_Circ FilletCirc;
// gp_Pnt NewPosition, EndOfArrow;
Handle( Prs3d_DimensionAspect ) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
Standard_Real ArrowLength = LA->ArrowAspect()->Length();
DsgPrs::ComputeFilletRadiusPresentation( ArrowLength,
@@ -101,7 +101,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
for (Standard_Integer i = 0 ; i < NodeNumber; i++, FirstParCirc += delta)
aPrims->AddVertex(ElCLib::Value( FirstParCirc, FilletCirc ));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
HasCircle = Standard_True;
Handle(Geom_Circle) Circle = new Geom_Circle( FilletCirc );
@@ -116,10 +116,10 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(DrawPosition);
aPrims->AddVertex(EndOfArrow);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// Drawing the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, DrawPosition);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, DrawPosition);
// Add presentation of arrows
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );

View File

@@ -28,6 +28,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
//=======================================================================
//function : Add
@@ -42,7 +43,7 @@ void DsgPrs_FixPresentation::Add(
const Standard_Real symbsize)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(10);
@@ -89,14 +90,14 @@ void DsgPrs_FixPresentation::Add(
aPrims->AddVertex(PF);
aPrims->AddVertex(PL);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor = LA->LineAspect()->Aspect()->Color();
Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
aPresentation->CurrentGroup()->SetPrimitivesAspect (aMarkerAsp);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}

View File

@@ -43,24 +43,24 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
const gp_Pnt& aPntOffset)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(aPntAttach);
aPrims->AddVertex(aPntOffset);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Quantity_Color aColor = LA->LineAspect()->Aspect()->Color();
Handle(Graphic3d_AspectMarker3d) aMarkerAsp = new Graphic3d_AspectMarker3d (Aspect_TOM_O, aColor, 1.0);
aPresentation->CurrentGroup()->SetPrimitivesAspect (aMarkerAsp);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect (aMarkerAsp);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
// texte
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntOffset);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
}
@@ -72,7 +72,7 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
const gp_Pnt& aPntOffset)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(4);
@@ -93,10 +93,10 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
else
aPrims->AddVertex(aSAttach);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntOffset);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
}
@@ -110,7 +110,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
const gp_Pnt& aPntOffset)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Ax2 ax = theAxe;
ax.SetLocation(aCenter);
@@ -141,10 +141,10 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntOffset);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
}
// jfa 16/10/2000
@@ -159,7 +159,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
const gp_Pnt& aPntOnCirc)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Ax2 ax = theAxe;
ax.SetLocation(aCenter);
@@ -190,10 +190,10 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntOffset);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
}
// jfa 16/10/2000 end
@@ -208,7 +208,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
const gp_Pnt& aPntOnElli)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Standard_Real pFAttach = ElCLib::Parameter(anEllipse, aFAttach);
Standard_Real pSAttach = ElCLib::Parameter(anEllipse, aSAttach);
@@ -235,9 +235,9 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
for (Standard_Integer i = 1; i<=nbp; i++)
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),anEllipse));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, aPntOffset);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
}
// jfa 10/10/2000 end

View File

@@ -34,6 +34,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -47,7 +48,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
const gp_Pnt& OffsetPoint)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Lin L1 (AttachmentPoint1,aDirection);
gp_Lin L2 (AttachmentPoint2,aDirection);
@@ -90,20 +91,20 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
arrdir.Reverse();
// arrow 1 : 2nd group
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), Proj1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
// arrow 2 : 3rd group
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(), Proj2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
aPresentation->NewGroup();
Prs3d_Root::NewGroup(aPresentation);
// text : 4th group
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, offp);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp);
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
// processing of call 1 : 5th group
aPrims->AddVertex(AttachmentPoint1);
@@ -113,7 +114,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(Proj2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
//==================================================================================
@@ -132,7 +133,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
const DsgPrs_ArrowSide ArrowPrs )
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Pnt EndOfArrow1, EndOfArrow2;
gp_Dir DirOfArrow1;
@@ -174,7 +175,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
// Drawing the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint);
// Line from AttachmentPoint1 to end of Arrow1
aPrims->AddVertex(AttachmentPoint1);
@@ -184,7 +185,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(EndOfArrow2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
@@ -203,7 +204,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
const DsgPrs_ArrowSide ArrowPrs)
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Lin L1 (AttachmentPoint1,aDirection);
gp_Lin L2 (AttachmentPoint2,aDirection);
@@ -254,10 +255,10 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
aPrims->AddVertex(AttachmentPoint2);
aPrims->AddVertex(Proj2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, offp);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp);
// symbols at the extremities of the face
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
@@ -280,7 +281,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
const DsgPrs_ArrowSide ArrowPrs )
{
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Pnt EndOfArrow2;
gp_Dir DirOfArrow1;
@@ -319,13 +320,13 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(FirstPoint);
aPrims->AddVertex(LastPoint);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// Add presentation of arrows
DsgPrs::ComputeSymbol( aPresentation, LA, AttachmentPoint1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
// Drawing the text
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint);
// Two curves from end of Arrow2 to AttachmentPoint2
Standard_Real Alpha, delta;
@@ -339,7 +340,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstU += delta)
aPrims->AddVertex(VCurve->Value( FirstU ));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
Alpha = Abs( deltaV );
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
@@ -349,7 +350,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstV += delta)
aPrims->AddVertex(UCurve->Value( FirstV ));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}
@@ -368,27 +369,27 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(Pt1);
aPrims->AddVertex(Pt2);
aPrs->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPrs)->AddPrimitiveArray(aPrims);
gp_Vec V ;
switch(ArrowPrs)
{
case DsgPrs_AS_LASTAR:
Prs3d_Arrow::Draw (aPrs->CurrentGroup(), Pt2, gp_Dir(gp_Vec(Pt1,Pt2)),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt2, gp_Dir(gp_Vec(Pt1,Pt2)),
aDrawer->DimensionAspect()->ArrowAspect()->Angle(),
aDrawer->DimensionAspect()->ArrowAspect()->Length());
break;
case DsgPrs_AS_FIRSTAR:
Prs3d_Arrow::Draw (aPrs->CurrentGroup(), Pt1, gp_Dir(gp_Vec(Pt2,Pt1)),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt1, gp_Dir(gp_Vec(Pt2,Pt1)),
aDrawer->DimensionAspect()->ArrowAspect()->Angle(),
aDrawer->DimensionAspect()->ArrowAspect()->Length());
break;
case DsgPrs_AS_BOTHAR:
V = gp_Vec(Pt1,Pt2);
Prs3d_Arrow::Draw (aPrs->CurrentGroup(), Pt2, gp_Dir(V),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt2, gp_Dir(V),
aDrawer->DimensionAspect()->ArrowAspect()->Angle(),
aDrawer->DimensionAspect()->ArrowAspect()->Length());
Prs3d_Arrow::Draw (aPrs->CurrentGroup(), Pt1, gp_Dir(V.Reversed()),
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt1, gp_Dir(V.Reversed()),
aDrawer->DimensionAspect()->ArrowAspect()->Angle(),
aDrawer->DimensionAspect()->ArrowAspect()->Length());
break;

View File

@@ -32,6 +32,7 @@
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -58,8 +59,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
if ( first )
{
// center of the symmetry - circle around the MidPoint
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
const Standard_Real alpha = 2. * M_PI;
const Standard_Integer nbp = 100;
@@ -75,26 +76,26 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
aPrims->AddVertex(Position); // text position
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
TCollection_ExtendedString aText(" (+)");
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, Position);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position);
}
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
{
if ( !first )
{
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
}
// segment from mid point to the geometry
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
aPrims->AddVertex(AttachPoint); // attach point to the geometry
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}
@@ -122,13 +123,13 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
gp_Circ aCircleM (ax,rad);
// segment on line
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(Point1);
aPrims->AddVertex(Point2);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
if ( first )
{
@@ -147,11 +148,11 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
aPrims->AddVertex(Position); // text position
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
TCollection_ExtendedString aText (" (+)");
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, Position);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position);
}
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
@@ -160,7 +161,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM));
aPrims->AddVertex(AttachPoint); // attach point to the geometry
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}
@@ -188,8 +189,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
gp_Circ aCircleM (ax,rad);
// segment on circle
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
@@ -202,7 +203,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
for (Standard_Integer i = 1; i <= nbp; i++)
aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
if ( first )
{
@@ -221,11 +222,11 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
aPrims->AddVertex(Position); // text position
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
TCollection_ExtendedString aText (" (+)");
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, Position);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position);
}
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
@@ -234,7 +235,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
aPrims->AddVertex(AttachPoint); // attach point to the geometry
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}
@@ -264,8 +265,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
gp_Circ aCircleM (ax,rad);
// segment on ellipse
aPresentation->NewGroup();
aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect());
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
@@ -278,7 +279,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
for (Standard_Integer i = 1; i <= nbp; i++)
aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
if ( first )
{
@@ -297,11 +298,11 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
aPrims->AddVertex(Position); // text position
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
// texte
TCollection_ExtendedString aText (" (+)");
Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, Position);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position);
}
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
@@ -310,6 +311,6 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
aPrims->AddVertex(AttachPoint); // attach point to the geometry
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
}
}

Some files were not shown because too many files have changed in this diff Show More