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

Compare commits

..

1 Commits

Author SHA1 Message Date
akaftasev
551d35ab93 0032839: BRepMesh_IncrementalMesh - The ability to pass progress indication to one of the constructors was not added
Added progress indication to the constructor of the BRepMesh_IncrementalMesh
2022-02-16 13:17:58 +03:00
6187 changed files with 22211 additions and 48649 deletions

View File

@@ -56,20 +56,6 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE})
# set soversion variable determining compatibility version on platforms with symlinks
# 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance
if (NOT BUILD_SOVERSION_NUMBERS)
set (BUILD_SOVERSION_NUMBERS "0" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE)
SET_PROPERTY(CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3)
# update default state of soversion on different platforms
if (WIN32 OR ANDROID OR EMSCRIPTEN)
set (BUILD_SOVERSION_NUMBERS 0)
else()
set (BUILD_SOVERSION_NUMBERS 2)
endif()
endif()
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# Regeneration of OCCT resource files
@@ -1239,7 +1225,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
install (CODE "file(INSTALL FILES \"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" DESTINATION \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/\" TYPE FILE)")
install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
foreach (OCCT_MODULE ${OCCT_MODULES})
if (BUILD_MODULE_${OCCT_MODULE})

View File

@@ -3,5 +3,5 @@ ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXDE TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh TKXDECascade
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -384,8 +384,6 @@ t TKSTEPBase
t TKSTL
t TKVRML
t TKXCAF
t TKXDE
t TKXDECascade
t TKXDEIGES
t TKXDESTEP
t TKXSBase
@@ -396,9 +394,6 @@ n DBRep
n DDF
n DDataStd
n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming
n DPrsStd
n Draw

View File

@@ -1,96 +1,4 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
if (NOT DEFINED INSTALL_DRACO)
set (INSTALL_DRACO OFF CACHE BOOL "${INSTALL_DRACO_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
set (3RDPARTY_DRACO_DIR "" CACHE PATH "The directory containing Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_INCLUDE_DIR)
set (3RDPARTY_DRACO_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY OR NOT 3RDPARTY_DRACO_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR)
set (3RDPARTY_DRACO_LIBRARY_DIR "" CACHE PATH "The directory containing Draco library")
endif()
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_DRACO_DIR OR NOT EXISTS "${3RDPARTY_DRACO_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" draco DRACO_DIR_NAME)
if (DRACO_DIR_NAME)
set (3RDPARTY_DRACO_DIR "${3RDPARTY_DIR}/${DRACO_DIR_NAME}" CACHE PATH "The directory containing Draco" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (DRACO_INCLUDE_PATH "${3RDPARTY_DRACO_DIR}/include")
set (DRACO_LIBRARY_PATH "${3RDPARTY_DRACO_DIR}/lib")
endif()
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR)
if (DRACO_INCLUDE_PATH AND EXISTS "${DRACO_INCLUDE_PATH}")
set (3RDPARTY_DRACO_INCLUDE_DIR "${DRACO_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of DRACO" FORCE)
endif()
endif()
if (NOT 3RDPARTY_DRACO_LIBRARY_DIR)
if (DRACO_LIBRARY_PATH AND EXISTS "${DRACO_LIBRARY_PATH}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${DRACO_LIBRARY_PATH}" CACHE FILEPATH "The directory containing DRACO library" FORCE)
endif()
endif()
if (3RDPARTY_DRACO_INCLUDE_DIR AND EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_DRACO_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DRACO_INCLUDE_DIR)
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_LIBRARY_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_LIBRARY_DIR AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_DRACO_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_DRACO_LIBRARY_DIR)
endif()
if (INSTALL_DRACO)
get_filename_component(3RDPARTY_DRACO_LIBRARY_REALPATH ${3RDPARTY_DRACO_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
THIRDPARTY_PRODUCT("DRACO" "draco/compression/decode.h" "CSF_Draco" "")

View File

@@ -25,9 +25,6 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")

View File

@@ -255,8 +255,7 @@ else()
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
if (NOT WIN32)
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -281,17 +280,14 @@ get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
set (OCC_SOVERSION "")
if (BUILD_SOVERSION_NUMBERS GREATER 2)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
if (ANDROID)
# do not append version to the filename
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
else()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_VERSION_MAJOR}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
endif()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_SOVERSION}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)

View File

@@ -28,9 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_SOVERSION_NUMBERS_DESCR
"Version numbers to put into SONAME: 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).

View File

@@ -119,8 +119,6 @@ android-g++ {
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else:equals(aMsvcVer, 17.0){
# VS2022, vc143
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}

View File

@@ -132,31 +132,21 @@ for (aPackage, aPackages) {
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.dylib.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .dylib files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .so files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -74,10 +74,6 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -111,11 +107,6 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -135,7 +126,6 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
if /I ["%1"] == ["vc141"] set "VCVER=vc14"
if /I ["%1"] == ["vc142"] set "VCVER=vc14"
if /I ["%1"] == ["vc143"] set "VCVER=vc14"
if exist "%CASROOT%\custom.bat" (
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%

View File

@@ -7,7 +7,6 @@ if exist "%~dp0custom.bat" (
call "@INSTALL_DIR_ABSOLUTE@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3
if /I ["%1"] == ["vc141"] set "VCVER=vc141"
if /I ["%1"] == ["vc142"] set "VCVER=vc142"
if /I ["%1"] == ["vc143"] set "VCVER=vc143"
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -100,7 +100,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
@@ -148,7 +148,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -196,7 +196,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
@@ -244,7 +244,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>

View File

@@ -95,7 +95,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
@@ -140,7 +140,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
@@ -185,7 +185,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
@@ -229,7 +229,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>

View File

@@ -2,48 +2,60 @@
==============================================
@tableofcontents
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://dev.opencascade.org/resources/download/3rd-party-components.
On Linux and macOS, it is recommended to use the version installed in the system natively.
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://opencascade.com/content/3rd-party-components.
On Linux and OS X, it is recommended to use the version installed in the system natively.
@section dev_guides__building_3rdparty_win_1 Windows
This section presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform.
It is assumed that you are already familiar with MS Visual Studio / Visual C++.
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform. It is assumed that you are already familiar with MS Visual Studio / Visual C++.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of runtime binaries.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, `c:/occ3rdparty`).
Further in this document, this folder is referred to as `3rdparty`.
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products used by OCCT:
* Mandatory products:
* Tcl/Tk 8.5 -- 8.6;
* FreeType 2.4.10 -- 2.5.3.
* Optional products:
* TBB 3.x -- 4.x;
* FreeImage 3.14.1 -- 3.16.0;
* VTK 6.1.0.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, *c:\\occ3rdparty*).
Further in this document, this folder is referred to as *3rdparty*.
@subsection dev_guides__building_3rdparty_win_2 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. In the `win` sub-directory, edit file `buildall.vc.bat`:
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
* Edit the line `"call ... vcvars32.bat"` to have correct path to the version of Visual Studio to be used for building, for instance:
* Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
call "%VS80COMNTOOLS%\vsvars32.bat"
If you are building 64-bit version, set environment accordingly, e.g.:
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
* Define variable `INSTALLDIR` pointing to directory where Tcl/Tk will be installed, e.g.:
* Define variable *INSTALLDIR* pointing to directory where Tcl/Tk will be installed, e.g.:
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
* Add option `install` to the first command line calling `nmake`:
* Add option *install* to the first command line calling *nmake*:
nmake -nologo -f makefile.vc release htmlhelp install %1
* Remove second call to `nmake` (building statically linked executable)
* Remove second call to *nmake* (building statically linked executable)
2. Edit file `rules.vc` replacing line
2. Edit file *rules.vc* replacing line
SUFX = tsgx
@@ -53,18 +65,21 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
3. By default, Tcl uses dynamic version of run-time library (MSVCRT), which must be installed on the system where Tcl will be used.
You may wish to link Tcl library with static version of run-time to avoid this dependency.
For that:
* Edit file `makefile.vc` replacing strings `"crt = -MD"` by `"crt = -MT"`
* Edit file *makefile.vc* replacing strings "crt = -MD" by "crt = -MT"
* Edit source file `tclMain.c` (located in folder `generic`) commenting out forward declaration of function `isatty()`.
* Edit source file *tclMain.c* (located in folder *generic*) commenting out forward declaration of function *isatty()*.
4. In the command prompt, run `buildall.vc.bat`<br>
You might need to run this script twice to have `tclsh` executable installed; check subfolder `bin` of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of `tclsh` executable created in subfolder `bin` of `INSTALLDIR` and named with Tcl version number suffix, as `tclsh.exe` (with no suffix)
4. In the command prompt, run *buildall.vc.bat*
You might need to run this script twice to have *tclsh* executable installed; check subfolder *bin* of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of *tclsh* executable created in subfolder *bin* of *INSTALLDIR* and named with Tcl version number suffix, as *tclsh.exe* (with no suffix)
> cd D:\OCCT\3rdparty\tcltk-86-32\bin
> cp tclsh86.exe tclsh.exe
@@ -72,153 +87,190 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
Apply the same steps as described for building Tcl above, with the same `INSTALLDIR`.
Note that Tk produces its own executable, called `wish`.
You might need to edit default value of `TCLDIR` variable defined in `buildall.vc.bat` (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
Note that Tk produces its own executable, called *wish*.
You might need to edit default value of *TCLDIR* variable defined in *buildall.vc.bat* (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
FreeType is required for text display in a 3D viewer.
You can download its sources from https://freetype.org/
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
1. Unpack the downloaded archive of FreeType product into the `3rdparty` folder.
As a result, you will get a folder named, for example, `3rdparty/freetype-2.4.10`.
Further in this document, this folder is referred to as `freetype`.
### The building procedure
2. Open the solution file `freetype/builds/win32/vc20xx/freetype.sln` in Visual Studio.
Here `vc20xx` stands for your version of Visual Studio.
1. Unpack the downloaded archive of FreeType product into the *3rdparty* folder. As a result, you will get a folder named, for example, *3rdparty\\freetype-2.4.10*. Further in this document, this folder is referred to as *freetype*.
2. Open the solution file *freetype\\builds\\win32\\vc20xx\\freetype.sln* in Visual Studio. Here *vc20xx* stands for your version of Visual Studio.
3. Select the configuration to build: either `Debug` or `Release`.
3. Select the configuration to build: either Debug or Release.
4. Build the `freetype` project.<br>
As a result, you will get a `freetype` import library (`.lib`) in the `freetype/obj/win32/vc20xx` folder.
4. Build the *freetype* project.
5. If you build FreeType for a 64 bit platform, select in the main menu `Build - Configuration Manager`
and add `x64` platform to the solution configuration by copying the settings from `Win32` platform:
As a result, you will get a freetype import library (.lib) in the *freetype\\obj\\win32\\vc20xx* folder.
5. If you build FreeType for a 64 bit platform, select in the main menu **Build - Configuration Manager** and add *x64* platform to the solution configuration by copying the settings from Win32 platform:
@figure{/build/build_3rdparty/images/3rdparty_image001.png}
Update the value of the Output File for `x64` configuration:
Update the value of the Output File for x64 configuration:
@figure{/build/build_3rdparty/images/3rdparty_image003.png}
Build the `freetype` project.<br>
As a result, you will obtain a 64 bit import library (`.lib`) file in the `freetype/x64/vc20xx` folder.
To build FreeType as a dynamic library (`.dll`) follow steps 6, 7 and 8 of this procedure.
Build the *freetype* project.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option `Configuration Type` to `Dynamic Library (.dll)`.
7. Edit file `freetype/include/freetype/config/ftoption.h`:<br>
in line 255, uncomment the definition of macro `FT_EXPORT` and change it as follows:
As a result, you will obtain a 64 bit import library (.lib) file in the *freetype\\x64\\vc20xx* folder.
#define FT_EXPORT(x) __declspec(dllexport) x
To build FreeType as a dynamic library (.dll) follow steps 6, 7 and 8 of this procedure.
8. Build the `freetype` project.<br>
As a result, you will obtain the files of the import library (`.lib`) and the dynamic library (`.dll`) in folders `freetype/objs/release` or `freetype/objs/debug`.
If you build for a 64 bit platform, follow step 5 of the procedure.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option **Configuration Type** to *Dynamic Library (.dll)*.
7. Edit file *freetype\\include\\freetype\\config\\ftoption.h*:
in line 255, uncomment the definition of macro *FT_EXPORT* and change it as follows:
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures,
it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern `freetype-compiler-bitness-building mode`, where:
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `bitness` is `32` or `64`;
* `building mode` is `opt` (for `Release`) or `deb` (for `Debug`).
#define FT_EXPORT(x) __declspec(dllexport) x
8. Build the *freetype* project.
As a result, you will obtain the files of the import library (.lib) and the dynamic library (.dll) in folders <i>freetype \\objs\\release</i> or <i>\\objs\\debug </i>.
If you build for a 64 bit platform, follow step 5 of the procedure.
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures, it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern: *freetype-compiler-bitness-building mode*, where:
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **bitness** is *32* or *64*;
* **building mode** is *opt* (for Release) or *deb* (for Debug).
The *include* subfolder should be copied as is, while libraries should be renamed to *freetype.lib* and *freetype.dll* (suffixes removed) and placed to subdirectories *lib *and *bin*, respectively. If the Debug configuration is built, the Debug libraries should be put into subdirectories *libd* and *bind*.
The `include` subfolder should be copied as is, while libraries should be renamed to `freetype.lib` and `freetype.dll` (suffixes removed) and placed to subdirectories `lib` and `bin`, respectively.
If the `Debug` configuration is built, the Debug libraries should be put into subdirectories `libd` and `bind`.
@subsection dev_guides__building_3rdparty_win_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. `tbb30_018oss`) and pick the archive for Windows platform.
This third-party product is installed with binaries
from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*) and pick the archive for Windows platform.
Unpack the downloaded archive of TBB product into the `3rdparty` folder.
Unpack the downloaded archive of TBB product into the *3rdparty* folder.
Further in this document, this folder is referred to as `tbb`.
Further in this document, this folder is referred to as *tbb*.
@subsection dev_guides__building_3rdparty_win_3_3 FreeImage
This third-party product should be built as a dynamically loadable library (`.dll` file).
You can download its sources from
This third-party product should be built as a dynamically loadable library (.dll file).
You can download its sources from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
1. Unpack the downloaded archive of FreeImage product into `3rdparty` folder.<br>
As a result, you should have a folder named `3rdparty/FreeImage`.
Rename it according to the rule: `freeimage-platform-compiler-building mode`, where
### The building procedure:
* `platform` is `win32` or `win64`;
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `building mode` is *opt* (for release) or `deb` (for debug)
1. Unpack the downloaded archive of FreeImage product into *3rdparty* folder.
As a result, you should have a folder named *3rdparty\\FreeImage*.
Rename it according to the rule: *freeimage-platform-compiler-building mode*, where
* **platform** is *win32* or *win64*;
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **building mode** is *opt* (for release) or *deb* (for debug)
Further in this document, this folder is referred to as `freeimage`.
Further in this document, this folder is referred to as *freeimage*.
2. Open the solution file `freeimage/FreeImage.*.sln` in your Visual Studio.<br>
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
2. Open the solution file *freeimage\\FreeImage.*.sln* in your Visual Studio.
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
3. Select a configuration to build.
3. Select a configuration to build.
- Choose `Release` if you are building Release binaries.
- Choose `Debug` if you are building Debug binaries.
- Choose **Release** if you are building Release binaries.
- Choose **Debug** if you are building Debug binaries.
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage projects:
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage and FreeimagePlus projects:
Project -> Properties -> Configuration Properties -> Linker -> General -> Output File
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.dll to FreeImage.dll
FreeImagePlus*d*.dll to FreeImagePlus.dll
Project -> Properties -> Configuration Properties -> Linker -> Debugging-> Generate Program Database File
FreeImage*d*.pdb to FreeImage.pdb
FreeImage*d*.pdb to FreeImage.pdb
FreeImagePlus*d*.pdb to FreeImagePlus.pdb
Project -> Properties -> Configuration Properties -> Linker -> Advanced-Import Library
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.lib to FreeImagePlus.lib
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.dll to FreeImagePlus.dll
FreeImagePlus*d*.lib to FreeImagePlus.lib
Additionally, rename in project FreeImagePlus
Additionally, rename in project FreeImagePlus
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
from FreeImage*d*.lib to FreeImage.lib
from FreeImage*d*.lib to FreeImage.lib
4. Select a platform to build.
4. Select a platform to build.
- Choose `Win32` if you are building for a 32 bit platform.
- Choose `x64` if you are building for a 64 bit platform.
- Choose *Win32* if you are building for a 32 bit platform.
- Choose *x64* if you are building for a 64 bit platform.
5. Start the building process.<br>
As a result, you should have the library files of FreeImage product in `freeimage/Dist` folder (`FreeImage.dll` and `FreeImage.lib`).
5. Start the building process.
As a result, you should have the library files of FreeImage product in *freeimage\\Dist* folder (*FreeImage.dll* and *FreeImage.lib*) and in *freeimage\\Wrapper\\FreeImagePlus\\dist* folder (*FreeImagePlus.dll* and *FreeImagePlus.lib*).
@subsection dev_guides__building_3rdparty_win_3_4 VTK
VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into `3rdparty` folder.<br>
As a result, you will get a folder named, for example, `3rdparty/VTK-6.1.0`.
Further in this document, this folder is referred to as `VTK`.
### The building procedure:
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
Further in this document, this folder is referred to as *VTK*.
2. Use CMake to generate VS projects for building the library:
- Start CMake-GUI and select `VTK` folder as source path, and the folder of your choice for VS project and intermediate build data.
- Start CMake-GUI and select VTK folder as source path, and the folder of your choice for VS project and intermediate build data.
- Click **Configure**.
- Select the VS version to be used from the ones you have installed (we recommend using VS 2015) and the architecture (32 or 64-bit).
- Generate VS projects with default CMake options. The open solution `VTK.sln` will be generated in the build folder.
- Generate VS projects with default CMake options. The open solution *VTK.sln* will be generated in the build folder.
3. Build project VTK in Release mode.
@section build_3rdparty_linux Linux
This section presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Linux platform.
This document presents additional guidelines for building third-party
products used by Open CASCADE Technology and samples on Linux platform.
The links for downloading the third-party products are available on the web site at
https://opencascade.com/content/3rd-party-components.
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;  
* FreeType 2.4.10 - 2.5.3;
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0;
* VTK 6.1.0.
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
**Debian-based distributives**
All 3rd-party products required for building of OCCT could be installed from official repositories.
You may install them from console using apt-get utility:
All 3rd-party products required for building of OCCT could be installed
from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev
sudo apt-get install rapidjson-dev libdraco-dev
@@ -227,148 +279,148 @@ Building is possible with C++ compliant compiler:
sudo apt-get install g++
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
cd TCL_SRC_DIR/unix
2. Run the `configure` command:
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`
make install
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tk source files are located (`TK_SRC_DIR`)
1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TK_SRC_DIR/unix
cd TCL_SRC_DIR/unix
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`.
2. Run the *configure* command:
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
3. If the configure command has finished successfully, start the building process:
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
make
make install
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`)
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
make install
cd TK_SRC_DIR/unix
2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
make install
@subsection dev_guides__building_3rdparty_linux_2_2 FreeType
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
2. Run the `configure` command:
2. Run the *configure* command:
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
3. If the *configure* command has finished successfully, start the building process:
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
make
3. If the `configure` command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`
make install
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
make install
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product.
@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it.
The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
In line 60 insert the following:
1. Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h`:<br>
In line 60 insert the following:
#include string.h
#include string.h
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
cd FREEIMAGE_SRC_DIR
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
3. Run the building process
make
cd FREEIMAGE_SRC_DIR
4. Run the installation process
3. Run the building process
make
4. Run the installation process
a. If you have the permission to write into directories `/usr/include` and `/usr/lib`, run the following command:
make install
b. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.gnu`:
a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
make install
b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
Change lines 7-9 from:
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
Change line 70 from:
Change line 70 from: 
ldconfig
to:
\#ldconfig
\#ldconfig
Then run the installation process by the following command:
Then run the installation process by the following command:
make DESTDIR=FREEIMAGE_INSTALL_DIR install
make DESTDIR=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
@@ -376,180 +428,201 @@ The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DI
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
### The building procedure:
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
1. Install or build `cmake` product from the source file.
2. Start `cmake` in GUI mode with the directory where the source files of *VTK* are located:
1. Install or build *cmake* product from the source file.
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
ccmake VTK_SRC_DIR
* Press `[c]` to make the initial configuration
* Define the necessary options in `VTK_INSTALL_PREFIX`
* Press `[c]` to make the final configuration
* Press `[g]` to generate `Makefile` and exit
* Press <i>[c]</i> to make the initial configuration
* Define the necessary options in *VTK_INSTALL_PREFIX*
* Press <i>[c]</i> to make the final configuration
* Press <i>[g]</i> to generate Makefile and exit
3. Start the building of VTK:
make
4. Start the installation of VTK. Binaries will be installed according to the `VTK_INSTALL_PREFIX` option.
4. Start the installation of VTK. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
make install
@section build_3rdparty_macos Mac OS X
This section presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
This document presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
Tcl/Tk is required for DRAW test harness.
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;
* FreeType 2.4.10 - 2.5.3.
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0
**Installation from sources: Tcl**
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
**Installation from sources: Tcl 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TCL_SRC_DIR/macosx
cd TCL_SRC_DIR/macosx
2. Run the `configure` command
2. Run the *configure* command
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process
3. If the *configure* command has finished successfully, start the building process
make
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*.
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`.
make install
make install
**Installation from sources: Tk**
**Installation from sources: Tk 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the source files of Tk are located (`TK_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
cd TK_SRC_DIR/macosx
cd TK_SRC_DIR/macosx
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`
2. Run the *configure* command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process:
3. If the *configure* command has finished successfully, start the building process:
make
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`).
4. If the building has finished successfully, start the installation of Tk. All binary and service files of the product will be copied to the directory defined by *TK_INSTALL_DIR* (usually it is TCL_INSTALL_DIR)
make install
make install
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
FreeType is required for text display in the 3D viewer.
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
cd FREETYPE_SRC_DIR
2. Run the `configure` command
2. Run the *configure* command
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
3. If the *configure* command has finished successfully, start the building process
3. If the `configure` command has finished successfully, start the building process
make
make
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*.
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`.
make install
@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
make install
This third-party product is installed with binaries from the archive
that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
@subsection dev_guides__building_3rdparty_osx_3_1 TBB
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. `tbb30_018oss`) and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`tbb30_018oss_osx.tgz`).
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage
Download the necessary archive from
Download the necessary archive from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
Note that for building FreeImage on Mac OS X 10.7 you should replace `Makefile.osx`
in `FREEIMAGE_SRC_DIR` by the corrected file, which you can find in attachment to issue [`#22811`](https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug) in OCCT Mantis bug tracker.
Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
(https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
1. If you build FreeImage 3.15.x you can skip this step.
1. If you build FreeImage 3.15.x you can skip this step.
Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
In line 60 insert the following:
Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:`<br>
In line 60 insert the following:
#include string.h
#include string.h
Modify <i>FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:</i>
In line 320 replace:
Modify `FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp`:<br>
In line 320 replace:
SwapShort(value);
SwapShort(value);
with:
with:
SwapShort(&value);
SwapShort(&value);
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
cd FREEIMAGE_SRC_DIR
cd FREEIMAGE_SRC_DIR
3. Run the building process
make
make
4. Run the installation process
4. Run the installation process
1. If you have the permission to write into <i>/usr/local/include</i> and <i>/usr/local/lib</i> directories, run the following command:
1. If you have the permission to write into `/usr/local/include` and `/usr/local/lib` directories, run the following command:
make install
make install
2. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.osx*:
2. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.osx`:<br>
Change line 49 from:
Change line 49 from:   
PREFIX ?= /usr/local
to:
PREFIX ?= $(PREFIX)
PREFIX ?= $(PREFIX)
  Change lines 65-69 from:
  Change lines 65-69 from:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
make clean

View File

@@ -324,7 +324,6 @@ The environment is defined in the file *custom.sh* (on Linux and macOS) or *cust
| vc141-uwp | 2017 (15) | UWP (Universal Windows Platform) | vc14-uwp |
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
| vc143 | 2022 (17) | Desktop (Windows API) | vc14 |
Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
That tool will analyze your environment and propose you to choose available options:

View File

@@ -462,7 +462,7 @@ To run any Open CASCADE Technology application you need to set the environment v
You can define the environment variables with env.bat script located in the
$CASROOT folder. This script accepts two arguments to be used:
the version of Visual Studio (vc12 -- vc143) and the architecture (win32 or win64).
the version of Visual Studio (vc12 -- vc142) and the architecture (win32 or win64).
The additional environment settings necessary for compiling OCCT libraries and samples
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.

View File

@@ -2333,8 +2333,3 @@ Applications extending OCCT 3D Viewer and calling OpenGL functions directly (lik
This header, as well as `OpenGl_GlCore20.hxx` and similar, no more include system OpenGL / OpenGL ES headers to define function table.
Application code calling OpenGL functions directly should be changed to either use `OpenGl_Context::core11fwd` (as designed)
or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hxx`).
@subsection upgrade_occt770_tooltriangulatedshape StdPrs_ToolTriangulatedShape
Method `StdPrs_ToolTriangulatedShape::Normal()` has been removed.
Please use `BRepLib_ToolTriangulatedShape::ComputeNormals()` to fill in normal attributes in triangulation and fetch them directly using `Poly_Triangulation::Normal()`.

View File

@@ -2044,47 +2044,43 @@ Creates a *MeshVS_Mesh* object based on STL file data. The object will be displa
meshfromstl mesh myfile.stl
~~~~
@subsubsection occt_draw_4_5_2 vsetdispmode
@subsubsection occt_draw_4_5_2 meshdispmode
Syntax:
~~~~{.php}
vsetdispmode meshname displaymode
meshdispmode meshname displaymode
~~~~
Changes the display mode of object **meshname**. The **displaymode** is integer (`MeshVS_DisplayModeFlags`), which can be:
* *1* for *wireframe*,
Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
* *1* for *wireframe*,
* *2* for *shading* mode, or
* *3* for *shrink* mode.
* *3* for *shrink* mode.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vsetdispmode mesh 2
vinit
meshfromstl mesh myfile.stl
meshdispmode mesh 2
~~~~
@subsubsection occt_draw_4_5_3 vselmode
@subsubsection occt_draw_4_5_3 meshselmode
Syntax:
~~~~{.php}
vselmode meshname selectionmode {on|off}
meshselmode meshname selectionmode
~~~~
Changes the selection mode of object **meshname**.
The *selectionmode* is integer OR-combination of mode flags (`MeshVS_SelectionModeFlags`). The basic flags are the following:
* *0* -- selection of mesh as whole;
Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following:
* *1* -- node selection;
* *2* -- 0D elements (not supported in STL);
* *4* -- links (not supported in STL);
* *8* -- faces;
* *16* -- volumes (not supported in STL);
* *256* -- groups (not supported in STL).
**Example:**
* *2* -- 0D elements (not supported in STL);
* *4* -- links (not supported in STL);
* *8* -- faces.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vselmode mesh 1
vinit
meshfromstl mesh myfile.stl
meshselmode mesh 1
~~~~
@subsubsection occt_draw_4_5_4 meshshadcolor
@@ -2095,11 +2091,11 @@ meshshadcolor meshname red green blue
~~~~
Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshadcolormode mesh 0.5 0.5 0.5
~~~~
@@ -2111,11 +2107,11 @@ meshlinkcolor meshname red green blue
~~~~
Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshlinkcolormode mesh 0.5 0.5 0.5
~~~~
@@ -2123,37 +2119,39 @@ meshlinkcolormode mesh 0.5 0.5 0.5
Syntax:
~~~~{.php}
meshmat meshname material [transparency]
meshmat meshname material
~~~~
Changes the material of object **meshname**.
*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
* *0 -- BRASS*,
* *1 -- BRONZE*,
* *2 -- COPPER*,
* *3 -- GOLD*,
* *4 -- PEWTER*,
* *5 -- PLASTER*,
* *6 -- PLASTIC*,
* *7 -- SILVER*,
* *8 -- STEEL*,
* *9 -- STONE*,
* *10 -- SHINY_PLASTIC*,
* *11 -- SATIN*,
* *12 -- METALIZED*,
* *13 -- NEON_GNC*,
* *14 -- CHROME*,
* *15 -- ALUMINIUM*,
* *16 -- OBSIDIAN*,
* *17 -- NEON_PHC*,
* *18 -- JADE*.
*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
* *0 -- BRASS,*
* *1 -- BRONZE,*
* *2 -- COPPER,*
* *3 -- GOLD,*
* *4 -- PEWTER,*
* *5 -- PLASTER,*
* *6 -- PLASTIC,*
* *7 -- SILVER,*
* *8 -- STEEL,*
* *9 -- STONE,*
* *10 -- SHINY_PLASTIC,*
* *11 -- SATIN,*
* *12 -- METALIZED,*
* *13 -- NEON_GNC,*
* *14 -- CHROME,*
* *15 -- ALUMINIUM,*
* *16 -- OBSIDIAN,*
* *17 -- NEON_PHC,*
* *18 -- JADE,*
* *19 -- DEFAULT,*
* *20 -- UserDefined*
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
meshmat mesh 18
vinit
meshfromstl mesh myfile.stl
meshmat mesh JADE
~~~~
@subsubsection occt_draw_4_5_7 meshshrcoef
@@ -2163,14 +2161,12 @@ Syntax:
meshshrcoef meshname shrinkcoefficient
~~~~
Changes the value of shrink coefficient used in the shrink mode.
In the shrink mode the face is shown as a congruent part of a usual face, so that *shrinkcoefficient* controls the value of this part.
The *shrinkcoefficient* is a positive real number.
**Example:**
Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that *shrinkcoefficient* controls the value of this part. The *shrinkcoefficient* is a positive real number.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshrcoef mesh 0.05
~~~~
@@ -2182,12 +2178,11 @@ meshshow meshname
~~~~
Displays **meshname** in the viewer (if it is erased).
The same as calling `vdisplay`.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshow mesh
~~~~
@@ -2198,13 +2193,12 @@ Syntax:
meshhide meshname
~~~~
Hides **meshname** in the viewer.
The same as calling `verase`.
Hides **meshname** in the viewer.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshhide mesh
~~~~
@@ -2215,7 +2209,7 @@ Syntax:
meshhidesel meshname
~~~~
Hides only selected entities. The other part of **meshname** remains visible.
Hides only selected entities. The other part of **meshname** remains visible.
@subsubsection occt_draw_4_5_11 meshshowsel
@@ -2224,7 +2218,7 @@ Syntax:
meshshowsel meshname
~~~~
Shows only selected entities. The other part of **meshname** becomes invisible.
Shows only selected entities. The other part of **meshname** becomes invisible.
@subsubsection occt_draw_4_5_12 meshshowall
@@ -2233,22 +2227,22 @@ Syntax:
meshshowall meshname
~~~~
Changes the state of all entities to visible for **meshname**.
Changes the state of all entities to visible for **meshname**.
@subsubsection occt_draw_4_5_13 vremove
@subsubsection occt_draw_4_5_13 meshdelete
Syntax:
~~~~{.php}
vremove meshname
meshdelete meshname
~~~~
Deletes MeshVS_Mesh object **meshname**.
Deletes MeshVS_Mesh object **meshname**.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vremove mesh
vinit
meshfromstl mesh myfile.stl
meshdelete mesh
~~~~
@subsection occt_draw_4_6 VIS Viewer commands

View File

@@ -338,8 +338,7 @@ The <i>GeomConvert</i> package also provides the following:
* a splitting algorithm, which determines the curves along which a BSpline surface should be cut in order to obtain patches with the same degree of continuity,
* global functions to construct BSpline surfaces created by this splitting algorithm, or by other types of BSpline surface segmentation,
* an algorithm, which converts a BSpline surface into a series of adjacent Bezier surfaces,
* an algorithm, which converts a grid of adjacent Bezier surfaces into a BSpline surface.
* algorithms that converts NURBS, Bezier and other general parametrized curves and surface into anaytical curves and surfaces.
* an algorithm, which converts a grid of adjacent Bezier surfaces into a BSpline surface.
@subsection occt_modat_1_4 Points on Curves

View File

@@ -1007,25 +1007,6 @@ Standard_Integer aNbOffsetSurfaces = aCheckContents.NbOffsetSurf();
Handle(TopTools_HSequenceOfShape) aSeqFaces = aCheckContents.OffsetSurfaceSec();
~~~~
@subsubsection occt_shg_3_2_4 Analysis of shape underlined geometry
Class *ShapeAnalysis_CanonicalRecognition* provides tools that analyze geometry of shape and explore the possibility of converting geometry into a canonical form.
Canonical forms for curves are lines, circles and ellipses.
Canonical forms for surfaces are planar, cylindrical, conical and spherical surfaces.
Recognition and converting into canonical form is performed according to maximal deviation criterium: maximal distance between initial and canonical geometrical objects must be less, than given value.
Analysis of curves is allowed for following shapes:
* edge - algorithm checks 3d curve of edge
* wire - algorithm checks 3d curves of all edges in order to convert them in the same analytical curve
Analysis of surfaces is allowed for following shapes:
* face - algorithm checks surface of face
* shell - algorithm checks surfaces of all faces in order to convert them in the same analytical surface
* edge - algorithm checks all surfaces that are shared by given edge in order convert one of them in analytical surface, which most close to the input sample surface.
* wire - the same as for edge, but algorithm checks all edges of wire in order to find analytical surface, which most close to the input sample surface.
@section occt_shg_4 Upgrading
Upgrading tools are intended for adaptation of shapes for better use by Open CASCADE Technology or for customization to particular needs, i.e. for export to another system.

View File

@@ -94,7 +94,6 @@ The types of STEP representation entities that are recognized are:
* geometrically_bounded_wireframe_shape_representation
* geometrically_bounded_surface_shape_representation
* hybrid representations (shape_representation containing models of different type)
* tessellated_shape_representation
@subsubsection occt_step_2_2_3 Topological entities
The types of STEP topological entities that can be translated are:
@@ -113,7 +112,6 @@ The types of STEP geometrical entities that can be translated are:
* directions
* curves
* surfaces
* triangulations
For further information see 2.4 Mapping STEP entities to Open CASCADE Technology shapes.
@@ -339,7 +337,7 @@ Specifies preferred type of representation of the shape of the product, in case
* 4 (GBSSR) -- Prefer GEOMETRICALLY_BOUNDED_SURFACE_SHAPE_REPRESENTATION
* 5 (FBSR) -- Prefer FACETTED_BREP_SHAPE_REPRESENTATION
* 6 (EBWSR) -- Prefer EDGE_BASED_WIREFRAME_SHAPE_REPRESENTATION
* 7 (GBWSR) -- Prefer GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION
* 7 (GBWSR) -- Prefer GEOMETRICALLY_BOUNDED_WIREFRAME _SHAPE_REPRESENTATION
When this option is not equal to 1, for products with multiple representations the representation having a type closest to the selected one in this list will be translated.
@@ -449,34 +447,6 @@ of for each of the two "AXIS2_PLACEMENT_3D" entities referenced by it. as follow
}
~~~~
<h4>read.step.tessellated:</h4>
Boolean flag regulating translation of entities that define tessellated geometry:
* TESSELLATED_SHAPE_REPRESENTATION
* TESSELLATED_SHELL
* TESSELLATED_SOLID
* TRIANGULATED_FACE
* COMPLEX_TRIANGULATED_FACE
Tesselated geometry is attached to shapes as objects of <i>Poly_Triangulation</i> type using STEP links.
* 0 (Off) -- do not translate
* 1 (On) -- translate
* 2 (OnNoBRep) - tessellation is read only for entities for which there is no BRep representation
Read this parameter with:
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("read.step.tessellated");
~~~~
Modify this parameter with:
~~~~{.cpp}
if(!Interface_Static::SetIVal("read.step.tessellated",1))
.. error ..
~~~~
Default value is 0 (On).
@subsubsection occt_step_2_3_4 Performing the STEP file translation
Perform the translation according to what you want to translate. You can choose either root entities (all or selected by the number of root), or select any entity by its number in the STEP file. There is a limited set of types of entities that can be used as starting entities for translation. Only the following entities are recognized as transferable:
@@ -494,11 +464,6 @@ Perform the translation according to what you want to translate. You can choose
* subtypes of face_surface (including advanced_face)
* subtypes of shape_representation_relationship
* context_dependent_shape_representation
* tessellated_shape_representation
* tessellated_shell
* tessellated_solid
* triangulated_face
* complex_triangulated_face
The following methods are used for translation:
@@ -718,10 +683,6 @@ Not all entities defining the assembly structure in the STEP file are translated
| | quasi_uniform_surface | Geom_BSplineSurface | |
| | rectangular_composite_surface | TopoDS_Compound | Contains *TopoDS_Faces* |
| | curve_bounded_surface | TopoDS_Face | |
| Tessellations | tessellated_shell | TopoDS_Shell | |
| | tessellated_solid | TopoDS_Solid | |
| | triangulated_face | TopoDS_Face | Contains *Poly_Triangulation* |
| | complex_triangulated_face | TopoDS_Face | Contains *Poly_Triangulation* |
@subsection occt_step_2_5 Tolerance management
@@ -784,7 +745,6 @@ The following default tolerances are used when creating shapes and how they are
* *StepToTopoDS_TranslatePolyLoop* constructs *TopoDS_Edges* in *TopoDS_Wire* with help of class *StepToTopoDS_TranslateEdge*. Their tolerances are not modified inside this method.
* *StepToTopoDS_TranslateFace* constructs *TopoDS_Face* with the initial value of tolerance. *TopoDS_Wire* on *TopoDS_Face* is constructed with the help of classes *StepToTopoDS_TranslatePolyLoop, StepToTopoDS_TranslateEdgeLoop* or *StepToTopoDS_TranslateVertexLoop*.
* *StepToTopoDS_TranslateShell* calls *StepToTopoDS_TranslateFace::Init* for each face. This class does not modify the tolerance value.
* *StepToTopoDS_TranslateSolid* calls *StepToTopoDS_TranslateFace::Init* for each face. This class does not modify the tolerance value.
* *StepToTopoDS_TranslateCompositeCurve* constructs *TopoDS_Edges* in *TopoDS_Wire* with help of class *BRepAPI_MakeEdge* and have a tolerance 10-7. Pcurves from a STEP file are translated if they are present and if *read.surfacecurve.mode* is not -3. The connection between segments of a composite curve (edges in the wire) is provided by calling method *ShapeFix_Wire::FixConnected()\** with a precision equal to the initial value of tolerance.
* *StepToTopoDS_TranslateCurveBoundedSurface* constructs *TopoDS_Face* with tolerance *Precision::Confusion()*. *TopoDS_Wire* on *TopoDS_Face* is constructed with the help of class *StepToTopoDS_TranslateCompositeCurve*. Missing pcurves are computed using projection algorithm with the help of method *ShapeFix_Face::FixPcurves()*. For resulting face method *ShapeFix::SameParameter()* is called. It calls standard *BRepLib::SameParameter* for each edge in each wire, which can either increase or decrease the tolerances of the edges and vertices. *SameParameter* writes the tolerance corresponding to the real deviation of pcurves from 3D curve which can be less or greater than the tolerance in a STEP file.
* *StepToTopoDS_Builder* a high level class. Its methods perform translation with the help of the classes listed above. If the value of *read.maxprecision.mode* is set to 1 then the tolerance of subshapes of the resulting shape is limited by 0 and *read.maxprecision.val*. Else this class does not change the tolerance value.
@@ -1011,34 +971,6 @@ if(!Interface_Static::SetIVal("write.step.vertex.mode",1))
~~~~
Default value is 0.
<h4>write.step.tessellated:</h4>
Boolean flag regulating writing of entities that define tessellated geometry:
* TESSELLATED_SHAPE_REPRESENTATION
* TESSELLATED_SHELL
* TESSELLATED_SOLID
* TRIANGULATED_FACE
Tesselated geometry is taken as objects of <i>Poly_Triangulation type</i> from the active <i>TopoDS_Face</i> triangulation.
* 0 (Off) -- do not write
* 1 (On) -- write
* 2 (OnNoBRep) - tessellation is written only for entities for which there is no BRep representation
Read this parameter with:
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("write.step.tessellated");
~~~~
Modify this parameter with:
~~~~{.cpp}
if(!Interface_Static::SetIVal("write.step.tessellated",1))
.. error ..
~~~~
Default value is 2 (OnNoBep).
@subsubsection occt_step_3_3_3 Performing the Open CASCADE Technology shape translation
An OCCT shape can be translated to STEP using one of the following models (shape_representations):
* manifold_solid_brep (advanced_brep_shape_representation)
@@ -1162,7 +1094,6 @@ The table below describes STEP entities, which are created when the assembly str
| | Geom_ToroidalSurface | toroidal_surface or degenerate_toroidal_surface | *degenerate_toroidal_surface* is produced if the minor radius is greater then the major one |
| | Geom_BezierSurface | b_spline_surface_with_knots | |
| | Geom_BsplineSurface | b_spline_surface_with_knots or rational_b_spline_surface | *rational_b_spline_surface* is produced if *Geom_BSplineSurface* is a rational Bspline |
| Triangulations | Poly_Triangulation | *triangulated_face* is produced for face active triangulation | |
@subsection occt_step_3_5 Tolerance management

File diff suppressed because it is too large Load Diff

View File

@@ -25,7 +25,6 @@
#include <AIS_InteractiveObject.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <TopoDS_Face.hxx>
#include <TColGeom_SequenceOfCurve.hxx>

View File

@@ -26,7 +26,9 @@
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_Texture2D.hxx>
#include <Graphic3d_Texture1D.hxx>
#include <Graphic3d_Texture1Dsegment.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Image_AlienPixMap.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <TopoDS_Edge.hxx>
@@ -79,7 +81,7 @@ void Sample2D_Image::SetContext (const Handle(AIS_InteractiveContext)& theContex
this->Set(TopoDS_Shape(myFace));
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
Handle(Graphic3d_Texture2D) aTexture = new Graphic3d_Texture2D (myFilename);
Handle(Graphic3d_Texture2Dmanual) aTexture = new Graphic3d_Texture2Dmanual(myFilename);
aTexture->DisableModulate();
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (aTexture);
myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn();

View File

@@ -24,7 +24,6 @@
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
//! AIS AIS interactive object for sample 2D marker
class Sample2D_Markers : public AIS_InteractiveObject

View File

@@ -7,7 +7,6 @@ if exist "%~dp0custom.bat" (
call "%CASROOT%\env.bat" %1 %2 %3
if /I ["%1"] == ["vc141"] set "VCVER=vc141"
if /I ["%1"] == ["vc142"] set "VCVER=vc142"
if /I ["%1"] == ["vc143"] set "VCVER=vc143"
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -362,7 +362,7 @@ void AIS_InteractiveContext::ObjectsForView (AIS_ListOfInteractive& theListOfIO
continue;
}
Handle(Graphic3d_ViewAffinity) anAffinity = anObjIter.Key()->ViewAffinity();
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (anObjIter.Key());
const Standard_Boolean isVisible = anAffinity->IsVisible (aViewId);
if (isVisible == theIsVisibleInView)
{
@@ -402,9 +402,17 @@ void AIS_InteractiveContext::SetViewAffinity (const Handle(AIS_InteractiveObject
return;
}
Handle(Graphic3d_ViewAffinity) anAffinity = theIObj->ViewAffinity();
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (theIObj);
Handle(Graphic3d_CView) aViewImpl = theView->View();
anAffinity->SetVisible (aViewImpl->Identification(), theIsVisible == Standard_True);
if (theIsVisible)
{
theView->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
else
{
theView->View()->ChangeHiddenObjects()->Add (theIObj.get());
}
}
//=======================================================================
@@ -437,8 +445,7 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
if (!myObjects.IsBound (theIObj))
{
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Displayed, theDispMode, theSelectionMode);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
myMainVwr->StructureManager()->RegisterObject (theIObj);
myMainPM->Display(theIObj, theDispMode);
if (theSelectionMode != -1)
{
@@ -514,8 +521,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
Standard_Integer aDispMode, aHiMod, aSelModeDef;
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
myMainVwr->StructureManager()->RegisterObject (theIObj);
}
// Register theIObj in the selection manager to prepare further activation of selection
@@ -1894,9 +1900,13 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
mgrSelector->Remove (anObj);
setObjectStatus (theIObj, PrsMgr_DisplayStatus_None, -1, -1);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->UnregisterObject (theIObj);
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
{
aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
if (!myLastPicked.IsNull())
{
if (myLastPicked->IsSameSelectable (theIObj))
@@ -2204,11 +2214,10 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView)
//function : BoundingBoxOfSelection
//purpose :
//=======================================================================
Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)& theView) const
Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection() const
{
Bnd_Box aBndSelected;
AIS_MapOfObjectOwners anObjectOwnerMap;
const Standard_Integer aViewId = !theView.IsNull() ? theView->View()->Identification() : -1;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
@@ -2218,13 +2227,6 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)&
continue;
}
Handle(Graphic3d_ViewAffinity) anAffinity = anObj->ViewAffinity();
const Standard_Boolean isVisible = aViewId == -1 || anAffinity->IsVisible (aViewId);
if (!isVisible)
{
continue;
}
if (anOwner == anObj->GlobalSelOwner())
{
Bnd_Box aTmpBnd;
@@ -2262,7 +2264,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
const Standard_Real theMargin,
const Standard_Boolean theToUpdate)
{
Bnd_Box aBndSelected = BoundingBoxOfSelection (theView);
Bnd_Box aBndSelected = BoundingBoxOfSelection();
if (!aBndSelected.IsVoid())
{
theView->FitAll (aBndSelected, theMargin, theToUpdate);
@@ -2672,10 +2674,12 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo (const Handle(V3d_View)& th
myDetectedSeq.Clear();
myLastActiveView = theView.get();
// preliminaries
// preliminaires
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
Standard_Boolean toUpdateViewer = Standard_False;
myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
// (the objects must be AIS_Shapes)
const Standard_Integer aDetectedNb = MainSelector()->NbPicked();

View File

@@ -42,7 +42,6 @@
#include <TCollection_AsciiString.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <Quantity_Color.hxx>
class V3d_Viewer;
@@ -503,10 +502,7 @@ public: //! @name Selection management
Standard_EXPORT AIS_StatusOfPick SelectDetected (const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection (const Handle(V3d_View)& theView) const;
Standard_DEPRECATED ("BoundingBoxOfSelection() should be called with View argument")
Bnd_Box BoundingBoxOfSelection() const { return BoundingBoxOfSelection (Handle(V3d_View)()); }
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Sets list of owner selected/deselected using specified selection scheme.
//! @param theOwners owners to change selection state

View File

@@ -17,8 +17,6 @@
#define _AIS_LightSource_HeaderFile
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <SelectMgr_EntityOwner.hxx>
class Select3D_SensitiveSphere;

View File

@@ -1071,7 +1071,7 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
return;
}
aPresentation->CStructure()->ViewAffinity = myViewAffinity;
aPresentation->CStructure()->ViewAffinity = thePM->StructureManager()->ObjectAffinity (Handle(Standard_Transient) (this));
if (anOwner->Mode() == AIS_MM_TranslationPlane)
{

View File

@@ -34,8 +34,6 @@ enum AIS_MouseGesture
AIS_MouseGesture_Pan, //!< view panning gesture
AIS_MouseGesture_RotateOrbit, //!< orbit rotation gesture
AIS_MouseGesture_RotateView, //!< view rotation gesture
AIS_MouseGesture_Drag, //!< object dragging;
//! press button to start, move mouse to define rectangle, release to finish
};
//! Map defining mouse gestures.

View File

@@ -22,7 +22,7 @@
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_Texture2D.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Prs3d_Drawer.hxx>
@@ -278,17 +278,17 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
TCollection_AsciiString aTextureDesc;
if (!myTexturePixMap.IsNull())
{
myTexture = new Graphic3d_Texture2D (myTexturePixMap);
myTexture = new Graphic3d_Texture2Dmanual (myTexturePixMap);
aTextureDesc = " (custom image)";
}
else if (myPredefTexture != Graphic3d_NOT_2D_UNKNOWN)
{
myTexture = new Graphic3d_Texture2D (myPredefTexture);
myTexture = new Graphic3d_Texture2Dmanual (myPredefTexture);
aTextureDesc = TCollection_AsciiString(" (predefined texture ") + myTexture->GetId() + ")";
}
else
{
myTexture = new Graphic3d_Texture2D (myTextureFile.ToCString());
myTexture = new Graphic3d_Texture2Dmanual (myTextureFile.ToCString());
aTextureDesc = TCollection_AsciiString(" (") + myTextureFile + ")";
}

View File

@@ -18,7 +18,6 @@
#include <AIS_Shape.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_NameOfTexture2D.hxx>
#include <Image_PixMap.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
@@ -27,7 +26,7 @@
#include <PrsMgr_PresentationManager.hxx>
class Graphic3d_AspectFillArea3d;
class Graphic3d_Texture2D;
class Graphic3d_Texture2Dmanual;
//! This class allows to map textures on shapes.
//! Presentations modes AIS_WireFrame (0) and AIS_Shaded (1) behave in the same manner as in AIS_Shape,
@@ -185,7 +184,7 @@ protected: //! @name overridden methods
protected: //! @name presentation fields
Handle(Graphic3d_Texture2D) myTexture;
Handle(Graphic3d_Texture2Dmanual) myTexture;
Handle(Graphic3d_AspectFillArea3d) myAspect;
protected: //! @name texture source fields

View File

@@ -92,7 +92,6 @@ AIS_ViewController::AIS_ViewController()
myTouchPanThresholdPx (4.0f),
myTouchZoomThresholdPx (6.0f),
myTouchZoomRatio (0.13f),
myTouchDraggingThresholdPx (6.0f),
//
myNbTouchesLast (0),
myUpdateStartPointPan (true),
@@ -117,37 +116,22 @@ AIS_ViewController::AIS_ViewController()
myRubberBand->SetDisplayMode (0);
myRubberBand->SetMutable (true);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_MouseGesture_Pan);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_Pan);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_SelectRectangle);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton, AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton,
AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton, AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton,
AIS_MouseGesture_Pan);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_Pan);
myMouseGestureMapDrag.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Drag);
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton, AIS_MouseGesture_Pan);
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Pan);
myXRTeleportHaptic.Duration = 3600.0f;
myXRTeleportHaptic.Frequency = 0.1f;
@@ -197,53 +181,6 @@ void AIS_ViewController::FlushViewEvents (const Handle(AIS_InteractiveContext)&
{
flushBuffers (theCtx, theView);
flushGestures(theCtx, theView);
if (theView->IsSubview())
{
// move input coordinates inside the view
const Graphic3d_Vec2i aDelta = theView->View()->SubviewTopLeft();
if (myGL.MoveTo.ToHilight || myGL.Dragging.ToStart)
{
myGL.MoveTo.Point -= aDelta;
}
if (myGL.Panning.ToStart)
{
myGL.Panning.PointStart -= aDelta;
}
if (myGL.Dragging.ToStart)
{
myGL.Dragging.PointStart -= aDelta;
}
if (myGL.Dragging.ToMove)
{
myGL.Dragging.PointTo -= aDelta;
}
if (myGL.OrbitRotation.ToStart)
{
myGL.OrbitRotation.PointStart -= Graphic3d_Vec2d (aDelta);
}
if (myGL.OrbitRotation.ToRotate)
{
myGL.OrbitRotation.PointTo -= Graphic3d_Vec2d (aDelta);
}
if (myGL.ViewRotation.ToStart)
{
myGL.ViewRotation.PointStart -= Graphic3d_Vec2d (aDelta);
}
if (myGL.ViewRotation.ToRotate)
{
myGL.ViewRotation.PointTo -= Graphic3d_Vec2d (aDelta);
}
for (Graphic3d_Vec2i& aPntIter : myGL.Selection.Points)
{
aPntIter -= aDelta;
}
for (Aspect_ScrollDelta& aZoomIter : myGL.ZoomActions)
{
aZoomIter.Point -= aDelta;
}
}
if (theToHandle)
{
HandleViewEvents (theCtx, theView);
@@ -324,21 +261,12 @@ void AIS_ViewController::flushBuffers (const Handle(AIS_InteractiveContext)& ,
myUI.Dragging.ToStop = false;
myGL.Dragging.ToStop = true;
}
else
else if (myUI.Dragging.ToStart)
{
if (myUI.Dragging.ToStart)
{
myUI.Dragging.ToStart = false;
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
if (myUI.Dragging.ToMove)
{
myUI.Dragging.ToMove = false;
myGL.Dragging.ToMove = true;
}
myUI.Dragging.ToStart = false;
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
myGL.Dragging.PointTo = myUI.Dragging.PointTo;
if (myUI.OrbitRotation.ToStart)
@@ -423,7 +351,6 @@ void AIS_ViewController::flushGestures (const Handle(AIS_InteractiveContext)& ,
const Graphic3d_Vec2d aRotDelta = aTouch.To - myGL.OrbitRotation.PointStart;
myGL.OrbitRotation.ToRotate = true;
myGL.OrbitRotation.PointTo = myGL.OrbitRotation.PointStart + aRotDelta * aRotAccel;
myGL.Dragging.ToMove = true;
myGL.Dragging.PointTo.SetValues ((int )aTouch.To.x(), (int )aTouch.To.y());
}
else
@@ -431,7 +358,6 @@ void AIS_ViewController::flushGestures (const Handle(AIS_InteractiveContext)& ,
const Graphic3d_Vec2d aRotDelta = aTouch.To - myGL.ViewRotation.PointStart;
myGL.ViewRotation.ToRotate = true;
myGL.ViewRotation.PointTo = myGL.ViewRotation.PointStart + aRotDelta * aRotAccel;
myGL.Dragging.ToMove = true;
myGL.Dragging.PointTo.SetValues ((int )aTouch.To.x(), (int )aTouch.To.y());
}
@@ -854,19 +780,6 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
UpdatePolySelection (thePoint, true);
break;
}
case AIS_MouseGesture_Drag:
{
if (myToAllowDragging)
{
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
}
else
{
myMouseActiveGesture = AIS_MouseGesture_NONE;
}
break;
}
case AIS_MouseGesture_NONE:
{
break;
@@ -874,19 +787,12 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
}
}
AIS_MouseGesture aSecGesture = AIS_MouseGesture_NONE;
if (myMouseGestureMapDrag.Find (theButtons | theModifiers, aSecGesture))
if (theButtons == Aspect_VKeyMouse_LeftButton
&& theModifiers == Aspect_VKeyFlags_NONE
&& myToAllowDragging)
{
if (aSecGesture == AIS_MouseGesture_Drag
&& myToAllowDragging)
{
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
if (myMouseActiveGesture == AIS_MouseGesture_NONE)
{
myMouseActiveGesture = aSecGesture;
}
}
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
}
}
@@ -1010,8 +916,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
const double aRotTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchRotationThresholdPx
: 0.0;
const Graphic3d_Vec2d aDeltaF (aDelta);
if (Abs (aDeltaF.x()) + Abs (aDeltaF.y()) > aRotTol)
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aRotTol)
{
const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel;
const Graphic3d_Vec2i aRotDelta = thePoint - myMousePressPoint;
@@ -1027,8 +932,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myUI.ViewRotation.PointTo = Graphic3d_Vec2d (myMousePressPoint.x(), myMousePressPoint.y())
+ Graphic3d_Vec2d (aRotDelta.x(), aRotDelta.y()) * aRotAccel;
}
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
@@ -1064,8 +967,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
const double aPanTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchPanThresholdPx
: 0.0;
const Graphic3d_Vec2d aDeltaF (aDelta);
if (Abs (aDeltaF.x()) + Abs (aDeltaF.y()) > aPanTol)
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aPanTol)
{
if (myUpdateStartPointPan)
{
@@ -1089,31 +991,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
}
break;
}
case AIS_MouseGesture_Drag:
{
if (!myToAllowDragging)
{
break;
}
const double aDragTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchDraggingThresholdPx
: 0.0;
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aDragTol)
{
const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel;
const Graphic3d_Vec2i aRotDelta = thePoint - myMousePressPoint;
myUI.ViewRotation.ToRotate = true;
myUI.ViewRotation.PointTo = Graphic3d_Vec2d (myMousePressPoint.x(), myMousePressPoint.y())
+ Graphic3d_Vec2d (aRotDelta.x(), aRotDelta.y()) * aRotAccel;
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
}
default:
{
break;
@@ -1631,11 +1508,10 @@ void AIS_ViewController::handleZoom (const Handle(V3d_View)& theView,
Graphic3d_Vec2i aWinSize;
theView->Window()->Size (aWinSize.x(), aWinSize.y());
const Graphic3d_Vec2d aWinSizeF (aWinSize);
const Graphic3d_Vec2d aPanFromCenterPx (double(theParams.Point.x()) - 0.5 * aWinSizeF.x(),
aWinSizeF.y() - double(theParams.Point.y()) - 1.0 - 0.5 * aWinSizeF.y());
aDxy.x() += -aViewDims1.X() * aPanFromCenterPx.x() / aWinSizeF.x();
aDxy.y() += -aViewDims1.Y() * aPanFromCenterPx.y() / aWinSizeF.y();
const Graphic3d_Vec2d aPanFromCenterPx (double(theParams.Point.x()) - 0.5 * double(aWinSize.x()),
double(aWinSize.y() - theParams.Point.y() - 1) - 0.5 * double(aWinSize.y()));
aDxy.x() += -aViewDims1.X() * aPanFromCenterPx.x() / double(aWinSize.x());
aDxy.y() += -aViewDims1.Y() * aPanFromCenterPx.y() / double(aWinSize.y());
}
//theView->Translate (aCam, aDxy.x(), aDxy.y());
@@ -1969,7 +1845,7 @@ gp_Pnt AIS_ViewController::GravityPoint (const Handle(AIS_InteractiveContext)& t
void AIS_ViewController::FitAllAuto (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
const Bnd_Box aBoxSel = theCtx->BoundingBoxOfSelection (theView);
const Bnd_Box aBoxSel = theCtx->BoundingBoxOfSelection();
const double aFitMargin = 0.01;
if (aBoxSel.IsVoid())
{
@@ -2690,17 +2566,6 @@ void AIS_ViewController::OnSelectionChanged (const Handle(AIS_InteractiveContext
//
}
// =======================================================================
// function : OnSubviewChanged
// purpose :
// =======================================================================
void AIS_ViewController::OnSubviewChanged (const Handle(AIS_InteractiveContext)& ,
const Handle(V3d_View)& ,
const Handle(V3d_View)& )
{
//
}
// =======================================================================
// function : OnObjectDragged
// purpose :
@@ -3048,7 +2913,8 @@ void AIS_ViewController::handleDynamicHighlight (const Handle(AIS_InteractiveCon
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;
}
else if (myGL.Dragging.ToMove)
else if (myGL.OrbitRotation.ToRotate
|| myGL.ViewRotation.ToRotate)
{
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
@@ -3076,8 +2942,6 @@ void AIS_ViewController::handleMoveTo (const Handle(AIS_InteractiveContext)& the
void AIS_ViewController::handleViewRedraw (const Handle(AIS_InteractiveContext)& ,
const Handle(V3d_View)& theView)
{
Handle(V3d_View) aParentView = theView->IsSubview() ? theView->ParentView() : theView;
// manage animation state
if (!myViewAnimation.IsNull()
&& !myViewAnimation->IsStopped())
@@ -3105,82 +2969,31 @@ void AIS_ViewController::handleViewRedraw (const Handle(AIS_InteractiveContext)&
myToAskNextFrame = true;
}
for (int aSubViewPass = 0; aSubViewPass < 2; ++aSubViewPass)
for (V3d_ListOfViewIterator aViewIter (theView->Viewer()->ActiveViewIterator()); aViewIter.More(); aViewIter.Next())
{
const bool isSubViewPass = (aSubViewPass == 0);
for (V3d_ListOfViewIterator aViewIter (theView->Viewer()->ActiveViewIterator()); aViewIter.More(); aViewIter.Next())
const Handle(V3d_View)& aView = aViewIter.Value();
if (aView->IsInvalidated()
|| (myToAskNextFrame && aView == theView))
{
const Handle(V3d_View)& aView = aViewIter.Value();
if (isSubViewPass
&& !aView->IsSubview())
if (aView->ComputedMode())
{
for (const Handle(V3d_View)& aSubviewIter : aView->Subviews())
{
if (aSubviewIter->Viewer() != theView->Viewer())
{
if (aSubviewIter->IsInvalidated())
{
if (aSubviewIter->ComputedMode())
{
aSubviewIter->Update();
}
else
{
aSubviewIter->Redraw();
}
}
else if (aSubviewIter->IsInvalidatedImmediate())
{
aSubviewIter->RedrawImmediate();
}
}
}
continue;
aView->Update();
}
else if (!isSubViewPass
&& aView->IsSubview())
else
{
continue;
}
if (aView->IsInvalidated()
|| (myToAskNextFrame && aView == theView))
{
if (aView->ComputedMode())
{
aView->Update();
}
else
{
aView->Redraw();
}
if (aView->IsSubview())
{
aView->ParentView()->InvalidateImmediate();
}
}
else if (aView->IsInvalidatedImmediate())
{
if (aView->IsSubview())
{
aView->ParentView()->InvalidateImmediate();
}
aView->RedrawImmediate();
aView->Redraw();
}
}
}
if (theView->IsSubview()
&& theView->Viewer() != aParentView->Viewer())
{
aParentView->RedrawImmediate();
else if (aView->IsInvalidatedImmediate())
{
aView->RedrawImmediate();
}
}
if (myToAskNextFrame)
{
// ask more frames
aParentView->Window()->InvalidateContent (Handle(Aspect_DisplayConnection)());
theView->Window()->InvalidateContent (Handle(Aspect_DisplayConnection)());
}
}
@@ -3425,36 +3238,6 @@ void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)&
{
const bool wasImmediateUpdate = theView->SetImmediateUpdate (false);
Handle(V3d_View) aPickedView;
if (theView->IsSubview()
|| !theView->Subviews().IsEmpty())
{
// activate another subview on mouse click
bool toPickSubview = false;
Graphic3d_Vec2i aClickPoint;
if (myGL.Selection.Tool == AIS_ViewSelectionTool_Picking
&& !myGL.Selection.Points.IsEmpty())
{
aClickPoint = myGL.Selection.Points.Last();
toPickSubview = true;
}
else if (!myGL.ZoomActions.IsEmpty())
{
//aClickPoint = myGL.ZoomActions.Last().Point;
//toPickSubview = true;
}
if (toPickSubview)
{
if (theView->IsSubview())
{
aClickPoint += theView->View()->SubviewTopLeft();
}
Handle(V3d_View) aParent = !theView->IsSubview() ? theView : theView->ParentView();
aPickedView = aParent->PickSubview (aClickPoint);
}
}
handleViewOrientationKeys (theCtx, theView);
const AIS_WalkDelta aWalk = handleNavigationKeys (theCtx, theView);
handleXRInput (theCtx, theView, aWalk);
@@ -3472,12 +3255,6 @@ void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)&
theView->SetImmediateUpdate (wasImmediateUpdate);
if (!aPickedView.IsNull()
&& aPickedView != theView)
{
OnSubviewChanged (theCtx, theView, aPickedView);
}
// make sure to not process the same events twice
myGL.Reset();
myToAskNextFrame = false;

View File

@@ -492,12 +492,6 @@ public:
const Handle(V3d_View)& theView,
AIS_DragAction theAction);
//! Callback called by HandleViewEvents() on Selection of another (sub)view.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void OnSubviewChanged (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theOldView,
const Handle(V3d_View)& theNewView);
//! Pick closest point under mouse cursor.
//! This method is expected to be called from rendering thread.
//! @param thePnt [out] result point
@@ -763,7 +757,6 @@ protected: //! @name mouse input variables
Standard_ShortReal myScrollZoomRatio; //!< distance ratio for mapping mouse scroll event to zoom; 15.0 by default
AIS_MouseGestureMap myMouseGestureMap; //!< map defining mouse gestures
AIS_MouseGestureMap myMouseGestureMapDrag; //!< secondary map defining mouse gestures for dragging
AIS_MouseGesture myMouseActiveGesture; //!< initiated mouse gesture (by pressing mouse button)
AIS_MouseSelectionSchemeMap
myMouseSelectionSchemes; //!< map defining selection schemes bound to mouse + modifiers
@@ -784,7 +777,6 @@ protected: //! @name multi-touch input variables
Standard_ShortReal myTouchPanThresholdPx; //!< threshold for starting two-touch panning gesture in pixels; 4 by default
Standard_ShortReal myTouchZoomThresholdPx; //!< threshold for starting two-touch zoom (pitch) gesture in pixels; 6 by default
Standard_ShortReal myTouchZoomRatio; //!< distance ratio for mapping two-touch zoom (pitch) gesture from pixels to zoom; 0.13 by default
Standard_ShortReal myTouchDraggingThresholdPx; //!< distance for starting one-touch dragging gesture in pixels; 6 by default
Aspect_Touch myTouchClick; //!< single touch position for handling clicks
OSD_Timer myTouchDoubleTapTimer; //!< timer for handling double tap

View File

@@ -859,7 +859,7 @@ Standard_Boolean AIS_ViewCube::HasAnimation() const
void AIS_ViewCube::viewFitAll (const Handle(V3d_View)& theView,
const Handle(Graphic3d_Camera)& theCamera)
{
Bnd_Box aBndBox = myToFitSelected ? GetContext()->BoundingBoxOfSelection (theView) : theView->View()->MinMaxValues();
Bnd_Box aBndBox = myToFitSelected ? GetContext()->BoundingBoxOfSelection() : theView->View()->MinMaxValues();
if (aBndBox.IsVoid()
&& myToFitSelected)
{
@@ -1016,7 +1016,7 @@ void AIS_ViewCube::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManage
Handle(Prs3d_Presentation) aHiPrs = GetHilightPresentation (thePrsMgr);
aHiPrs->Clear();
aHiPrs->CStructure()->ViewAffinity = myViewAffinity;
aHiPrs->CStructure()->ViewAffinity = thePrsMgr->StructureManager()->ObjectAffinity (Handle(Standard_Transient)(this));
aHiPrs->SetTransformPersistence (TransformPersistence());
aHiPrs->SetZLayer (aLayer);

View File

@@ -87,13 +87,12 @@ public:
struct _draggingParams
{
bool ToStart; //!< start dragging
bool ToMove; //!< perform dragging
bool ToStop; //!< stop dragging
bool ToAbort; //!< abort dragging (restore previous position)
Graphic3d_Vec2i PointStart; //!< drag start point
Graphic3d_Vec2i PointTo; //!< drag end point
_draggingParams() : ToStart (false), ToMove (false), ToStop (false), ToAbort (false) {}
_draggingParams() : ToStart (false), ToStop (false), ToAbort (false) {}
} Dragging;
struct _orbitRotation
@@ -142,7 +141,6 @@ public:
Panning.ToStart = false;
Panning.ToPan = false;
Dragging.ToStart = false;
Dragging.ToMove = false;
Dragging.ToStop = false;
Dragging.ToAbort = false;
OrbitRotation.ToStart = false;

View File

@@ -15,7 +15,6 @@
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Graphic3d_Group.hxx>
#include <Image_Texture.hxx>
#include <Prs3d_LineAspect.hxx>
@@ -24,14 +23,14 @@
#include <SelectMgr_EntityOwner.hxx>
//! Texture holder.
class AIS_XRTrackedDevice::XRTexture : public Graphic3d_Texture2D
class AIS_XRTrackedDevice::XRTexture : public Graphic3d_Texture2Dmanual
{
public:
//! Constructor.
XRTexture (const Handle(Image_Texture)& theImageSource,
const Graphic3d_TextureUnit theUnit = Graphic3d_TextureUnit_BaseColor)
: Graphic3d_Texture2D (""), myImageSource (theImageSource)
: Graphic3d_Texture2Dmanual (""), myImageSource (theImageSource)
{
if (!theImageSource->TextureId().IsEmpty())
{

View File

@@ -99,10 +99,10 @@ static gp_Parab to3d(const gp_Pln& Pl, const gp_Parab2d& P)
return gp_Parab(to3d(Pl,P.Axis()),P.Focal());
}
static gp_Vec SetLinearForm(const gp_Vec2d& DW, const gp_Vec2d& D2W, const gp_Vec2d& D3W,
const gp_Vec& D1U, const gp_Vec& D1V, const gp_Vec& D2U,
const gp_Vec& D2V, const gp_Vec& D2UV, const gp_Vec& D3U,
const gp_Vec& D3V, const gp_Vec& D3UUV,const gp_Vec& D3UVV)
static gp_Vec SetLinearForm(const gp_Vec2d DW, const gp_Vec2d D2W,const gp_Vec2d D3W,
const gp_Vec D1U, const gp_Vec D1V, const gp_Vec D2U,
const gp_Vec D2V, const gp_Vec D2UV, const gp_Vec D3U,
const gp_Vec D3V, const gp_Vec D3UUV,const gp_Vec D3UVV)
{gp_Vec V31, V32, V33, V34,V3 ;
V31.SetLinearForm(DW.X(),D1U,
D2W.X()*DW.X(),D2U,

View File

@@ -114,20 +114,19 @@ public:
Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const;
Standard_EXPORT virtual Standard_Real VPeriod() const;
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT virtual void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
//! Computes the point and the first derivatives on the surface.
//! Raised if the continuity of the current intervals is not C1.
//!
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
//! Computes the point and the first derivatives on
//! the surface.
//! Raised if the continuity of the current
//! intervals is not C1.
Standard_EXPORT virtual void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
//! Computes the point, the first and second
//! derivatives on the surface.
//! Raised if the continuity of the current

View File

@@ -30,6 +30,34 @@ IMPLEMENT_STANDARD_RTTIEXT(Adaptor3d_TopolTool,Standard_Transient)
#define myInfinite Precision::Infinite()
static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real& V)
{
const gp_Ax3& Pos = C.Position();
Standard_Real Radius = C.RefRadius();
Standard_Real SAngle = C.SemiAngle();
const gp_Pnt& P = C.Apex();
gp_Trsf T;
T.SetTransformation (Pos);
gp_Pnt Ploc = P.Transformed (T);
if(Ploc.X() ==0.0 && Ploc.Y()==0.0 ) {
U = 0.0;
}
else if ( -Radius > Ploc.Z()* Tan(SAngle) ) {
// the point is at the `wrong` side of the apex
U = atan2(-Ploc.Y(), -Ploc.X());
}
else {
U = atan2(Ploc.Y(),Ploc.X());
}
if (U < -1.e-16) U += (M_PI+M_PI);
else if (U < 0) U = 0;
V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius)
+ cos(SAngle) * Ploc.Z();
}
Adaptor3d_TopolTool::Adaptor3d_TopolTool ()
: myNbSamplesU(-1),
@@ -1348,39 +1376,3 @@ Standard_Boolean Adaptor3d_TopolTool::IsUniformSampling() const
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : GetConeApexParam
//purpose : Computes the cone's apex parameters
//=======================================================================
void Adaptor3d_TopolTool::GetConeApexParam (const gp_Cone& theC, Standard_Real& theU, Standard_Real& theV)
{
const gp_Ax3& Pos = theC.Position();
Standard_Real Radius = theC.RefRadius();
Standard_Real SAngle = theC.SemiAngle();
const gp_Pnt& P = theC.Apex();
gp_Trsf T;
T.SetTransformation(Pos);
gp_Pnt Ploc = P.Transformed(T);
if (Ploc.X() == 0.0 && Ploc.Y() == 0.0)
{
theU = 0.0;
}
else if (-Radius > Ploc.Z() * Tan(SAngle))
{
// the point is at the `wrong` side of the apex
theU = atan2(-Ploc.Y(), -Ploc.X());
}
else
{
theU = atan2(Ploc.Y(), Ploc.X());
}
if (theU < -1.e-16) theU += (M_PI + M_PI);
else if (theU < 0) theU = 0;
theV = sin(SAngle) * (Ploc.X() * cos(theU) + Ploc.Y() * sin(theU) - Radius)
+ cos(SAngle) * Ploc.Z();
}

View File

@@ -146,12 +146,6 @@ public:
//! Returns true if provide uniform sampling of points.
Standard_EXPORT virtual Standard_Boolean IsUniformSampling() const;
//! Computes the cone's apex parameters.
//! @param[in] theC conical surface
//! @param[in] theU U parameter of cone's apex
//! @param[in] theV V parameter of cone's apex
Standard_EXPORT static void GetConeApexParam (const gp_Cone& theC, Standard_Real& theU, Standard_Real& theV);
DEFINE_STANDARD_RTTIEXT(Adaptor3d_TopolTool,Standard_Transient)
protected:

View File

@@ -108,7 +108,7 @@ void Approx_SameParameter_Evaluator::Evaluate (Standard_Integer *,/*Dimension*/
//purpose :
//=======================================================================
static void ProjectPointOnCurve(const Standard_Real InitValue,
const gp_Pnt& APoint,
const gp_Pnt APoint,
const Standard_Real Tolerance,
const Standard_Integer NumIteration,
const Adaptor3d_Curve& Curve,
@@ -526,8 +526,6 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
}
myDone = Standard_True;
}
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS.ShallowCopy());
}
//=======================================================================

View File

@@ -81,21 +81,6 @@ public:
return myCurve2d;
}
//! Returns the 3D curve that has the same parameter as
//! the 3D curve once evaluated on the surface up to the
//! specified tolerance.
Handle(Adaptor3d_Curve) Curve3d() const
{
return myC3d;
}
//! Returns the 3D curve on surface that has the same parameter as
//! the 3D curve up to the specified tolerance.
Handle(Adaptor3d_CurveOnSurface) CurveOnSurface() const
{
return myCurveOnSurface;
}
private:
//! Internal data structure to unify access to the most actively used data.
@@ -191,7 +176,6 @@ private:
Handle(Adaptor2d_Curve2d) myHCurve2d;
Handle(Adaptor3d_Curve) myC3d;
Handle(Adaptor3d_Surface) mySurf;
Handle(Adaptor3d_CurveOnSurface) myCurveOnSurface;
};
#endif // _Approx_SameParameter_HeaderFile

View File

@@ -40,58 +40,18 @@ class Aspect_Window : public Standard_Transient
DEFINE_STANDARD_RTTIEXT(Aspect_Window, Standard_Transient)
public:
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns window top-left corner.
Graphic3d_Vec2i TopLeft() const
{
Graphic3d_Vec2i aTopLeft, aBotRight;
Position (aTopLeft.x(), aTopLeft.y(), aBotRight.x(), aBotRight.y());
return aTopLeft;
}
//! Returns window dimensions.
Graphic3d_Vec2i Dimensions() const
{
Graphic3d_Vec2i aSize;
Size (aSize.x(), aSize.y());
return aSize;
}
//! Returns connection to Display or NULL.
const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& theBack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Quantity_Color& theColor);
Standard_EXPORT void SetBackground (const Quantity_Color& color);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& theBackground);
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
public:
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Opens the window <me>.
Standard_EXPORT virtual void Map() const = 0;
@@ -105,6 +65,25 @@ public:
//! and returns TRUE if the window is mapped at screen.
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns The Window RATIO equal to the physical
//! WIDTH/HEIGHT dimensions
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
@@ -124,6 +103,9 @@ public:
//! Returns native Window FB config (GLXFBConfig on Xlib)
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
//! Returns connection to Display or NULL.
const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
//! Sets window title.
virtual void SetTitle (const TCollection_AsciiString& theTitle) { (void )theTitle; }

View File

@@ -525,7 +525,7 @@ protected:
Standard_EXPORT void UpdateEdgeTolerance(const Standard_Integer nE,
const Standard_Real aTolNew);
Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger& theEdges);
Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger theEdges);
Standard_EXPORT void CorrectToleranceOfSE();

View File

@@ -3394,7 +3394,7 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks
//function : RemovePaveBlocks
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges)
void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger theEdges)
{
// Remove all pave blocks referring to input edges:
//

View File

@@ -141,18 +141,17 @@ public:
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf.VPeriod(); }
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const Standard_OVERRIDE;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
//! Computes the point and the first derivatives on the surface.
//! Raised if the continuity of the current intervals is not C1.
//!
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
//! Computes the point and the first derivatives on
//! the surface.
//! Raised if the continuity of the current
//! intervals is not C1.
Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
//! Computes the point, the first and second
//! derivatives on the surface.
//! Raised if the continuity of the current

View File

@@ -334,7 +334,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if(Only2d && Only3d) {
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
Udeb, Ufin);
Ufin, Udeb);
prj = MKed.Edge();
BB.UpdateEdge(TopoDS::Edge(prj),
PCur2d,

View File

@@ -15,8 +15,186 @@
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepTools_CopyModification.hxx>
#include <BRepTools_Modification.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <Poly_Triangulation.hxx>
namespace {
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification
{
public:
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom,
const Standard_Boolean copyMesh)
: myCopyGeom(copyGeom),
myCopyMesh(copyMesh)
{
}
//! Returns true to indicate the need to copy face;
//! copies surface if requested
Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S,
TopLoc_Location& L, Standard_Real& Tol,
Standard_Boolean& RevWires, Standard_Boolean& RevFace) Standard_OVERRIDE
{
S = BRep_Tool::Surface(F,L);
Tol = BRep_Tool::Tolerance(F);
RevWires = RevFace = Standard_False;
if ( ! S.IsNull() && myCopyGeom )
S = Handle(Geom_Surface)::DownCast(S->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy triangulation;
//! copies it if required
Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (F))
{
return Standard_False;
}
TopLoc_Location L;
T = BRep_Tool::Triangulation(F, L);
if (T.IsNull())
return Standard_False;
// mesh is copied if and only if the geometry need to be copied too
if (myCopyGeom)
T = T->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies curves if requested
Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C,
TopLoc_Location& L, Standard_Real& Tol) Standard_OVERRIDE
{
Standard_Real f,l;
C = BRep_Tool::Curve (E, L, f, l);
Tol = BRep_Tool::Tolerance(E);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom_Curve)::DownCast(C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy polygon;
//! copies it if required
Standard_Boolean NewPolygon(const TopoDS_Edge& E, Handle(Poly_Polygon3D)& P) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (E))
{
return Standard_False;
}
TopLoc_Location aLoc;
P = BRep_Tool::Polygon3D(E, aLoc);
if (P.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
P = P->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy polygon;
//! copies it if required
Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F,
Handle(Poly_PolygonOnTriangulation)& P) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (E))
{
return Standard_False;
}
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(F, aLoc);
P = BRep_Tool::PolygonOnTriangulation(E, aTria, aLoc);
if (P.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
P = P->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P,
Standard_Real& Tol) Standard_OVERRIDE
{
P = BRep_Tool::Pnt(V);
Tol = BRep_Tool::Tolerance(V);
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies pcurve if requested
Standard_Boolean NewCurve2d (const TopoDS_Edge& E,
const TopoDS_Face& F,
const TopoDS_Edge& /*NewE*/,
const TopoDS_Face& /*NewF*/,
Handle(Geom2d_Curve)& C,
Standard_Real& Tol) Standard_OVERRIDE
{
Tol = BRep_Tool::Tolerance(E);
Standard_Real f, l;
C = BRep_Tool::CurveOnSurface (E, F, f, l);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom2d_Curve)::DownCast (C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E,
Standard_Real& P, Standard_Real& Tol) Standard_OVERRIDE
{
if (V.IsNull()) return Standard_False; // infinite edge may have Null vertex
Tol = BRep_Tool::Tolerance(V);
P = BRep_Tool::Parameter (V, E);
return Standard_True;
}
//! Returns the continuity of E between F1 and F2
GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1,
const TopoDS_Face& F2, const TopoDS_Edge&,
const TopoDS_Face&, const TopoDS_Face&) Standard_OVERRIDE
{
return BRep_Tool::Continuity (E, F1, F2);
}
public:
DEFINE_STANDARD_RTTI_INLINE(BRepBuilderAPI_Copy_Modification,BRepTools_Modification)
private:
Standard_Boolean myCopyGeom;
Standard_Boolean myCopyMesh;
};
} // anonymous namespace
//=======================================================================
//function : BRepBuilderAPI_Copy
@@ -25,7 +203,7 @@
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
{
myModification = new BRepTools_CopyModification(Standard_True, Standard_False);
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True, Standard_False);
}
@@ -36,7 +214,7 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepTools_CopyModification(copyGeom, copyMesh);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
DoModif(S);
}
@@ -48,7 +226,7 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_B
void BRepBuilderAPI_Copy::Perform(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepTools_CopyModification(copyGeom, copyMesh);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
NotDone(); // on force la copie si on vient deja d`en faire une
DoModif(S);
}

View File

@@ -1,247 +0,0 @@
// Created on: 2022-06-30
// Created by: Alexander MALYSHEV
// Copyright (c) 2022-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeShapeOnMesh.hxx>
#include <BRep_Builder.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <NCollection_IndexedDataMap.hxx>
namespace
{
//! Structure representing mesh edge.
struct Edge
{
//! Constructor. Sets edge nodes.
Edge(const Standard_Integer TheIdx1,
const Standard_Integer TheIdx2)
: Idx1(Min(TheIdx1, TheIdx2)),
Idx2(Max(TheIdx1, TheIdx2))
{}
//! Comparison operator.
Standard_Boolean operator<(const Edge& other) const
{
if (Idx1 < other.Idx1 ||
(Idx1 == other.Idx1 && Idx2 < other.Idx2))
{
return Standard_True;
}
return Standard_False;
}
//! First index. It is lower or equal than the second.
Standard_Integer Idx1;
//! Second index.
Standard_Integer Idx2;
};
//! Hasher of Edge structure.
struct EdgeHasher
{
//! Returns hash code for the given edge.
static Standard_Integer HashCode(const Edge& theEdge,
const Standard_Integer theUpperBound)
{
// Circle-based collisions.
return ::HashCode(theEdge.Idx1 * theEdge.Idx1 + theEdge.Idx2 * theEdge.Idx2, theUpperBound);
}
//! Returns true if two edges are equal.
static Standard_Boolean IsEqual(const Edge& theEdge1,
const Edge& theEdge2)
{
return theEdge1.Idx1 == theEdge2.Idx1 && theEdge1.Idx2 == theEdge2.Idx2;
}
};
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange)
{
// Generally, this method guarantees topology sharing by mapping mesh primitives
// into topological counterparts.
// mesh points -> topological vertices
// mesh edges -> topological edges
// Cannot reconstruct anything from null or empty mesh.
if (myMesh.IsNull() || myMesh->NbNodes() == 0 || myMesh->NbTriangles() == 0)
return;
const Standard_Integer aNbNodes = myMesh->NbNodes();
const Standard_Integer aNbTriangles = myMesh->NbTriangles();
// We are going to have three loops: iterate once over nodes and iterate twice
// over triangles of input mesh.
Message_ProgressScope aPS(theRange,
"Per-facet shape construction",
Standard_Real(aNbNodes + 2 * aNbTriangles));
// Build shared vertices.
NCollection_IndexedDataMap<Standard_Integer, TopoDS_Vertex> aPnt2VertexMap;
for (Standard_Integer i = 1; i <= aNbNodes; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
const gp_Pnt aP = myMesh->Node(i);
const TopoDS_Vertex aV = BRepBuilderAPI_MakeVertex(aP);
aPnt2VertexMap.Add(i, aV);
}
// Build shared edges.
NCollection_IndexedDataMap<Edge, TopoDS_Edge, EdgeHasher> anEdgeToTEgeMap;
for (Standard_Integer i = 1; i <= aNbTriangles; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
Standard_Integer anIdx[3];
const Poly_Triangle& aTriangle = myMesh->Triangle(i);
aTriangle.Get(anIdx[0], anIdx[1], anIdx[2]);
// Skip degenerated triangles.
if (anIdx[0] == anIdx[1] || anIdx[0] == anIdx[2] || anIdx[1] == anIdx[2])
continue;
const gp_Pnt aP1 = myMesh->Node(anIdx[0]);
const gp_Pnt aP2 = myMesh->Node(anIdx[1]);
const gp_Pnt aP3 = myMesh->Node(anIdx[2]);
const Standard_Real aD1 = aP1.SquareDistance(aP2);
const Standard_Real aD2 = aP1.SquareDistance(aP3);
const Standard_Real aD3 = aP2.SquareDistance(aP3);
if (aD1 < gp::Resolution() ||
aD2 < gp::Resolution() ||
aD3 < gp::Resolution())
{
continue;
}
// Edges are constructed in forward order for the existing normals orientation.
// In Poly_Triangulation, positive direction is defined as cross product:
// (aV1, aV2) x (aV1, aV3).
const TopoDS_Vertex& aV1 = aPnt2VertexMap.FindFromKey(anIdx[0]);
const TopoDS_Vertex& aV2 = aPnt2VertexMap.FindFromKey(anIdx[1]);
const TopoDS_Vertex& aV3 = aPnt2VertexMap.FindFromKey(anIdx[2]);
const Edge aMeshEdge1(anIdx[0], anIdx[1]);
const Edge aMeshEdge2(anIdx[1], anIdx[2]);
const Edge aMeshEdge3(anIdx[2], anIdx[0]);
BRepBuilderAPI_MakeEdge aMaker1(aV1, aV2);
BRepBuilderAPI_MakeEdge aMaker2(aV2, aV3);
BRepBuilderAPI_MakeEdge aMaker3(aV3, aV1);
TopoDS_Edge aTE1 = aMaker1.Edge();
if (anIdx[1] < anIdx[0])
aTE1.Reverse();
TopoDS_Edge aTE2 = aMaker2.Edge();
if (anIdx[2] < anIdx[1])
aTE2.Reverse();
TopoDS_Edge aTE3 = aMaker3.Edge();
if (anIdx[0] < anIdx[2])
aTE3.Reverse();
anEdgeToTEgeMap.Add(aMeshEdge1, aTE1);
anEdgeToTEgeMap.Add(aMeshEdge2, aTE2);
anEdgeToTEgeMap.Add(aMeshEdge3, aTE3);
}
// Construct planar faces using shared topology.
TopoDS_Compound aResult;
BRep_Builder aBB;
aBB.MakeCompound(aResult);
for (Standard_Integer i = 1; i <= aNbTriangles; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
Standard_Integer anIdx[3];
const Poly_Triangle& aTriangle = myMesh->Triangle(i);
aTriangle.Get(anIdx[0], anIdx[1], anIdx[2]);
const Edge aMeshEdge1(anIdx[0], anIdx[1]);
const Edge aMeshEdge2(anIdx[1], anIdx[2]);
const Edge aMeshEdge3(anIdx[2], anIdx[0]);
const Standard_Boolean isReversed1 = anIdx[1] < anIdx[0];
const Standard_Boolean isReversed2 = anIdx[2] < anIdx[1];
const Standard_Boolean isReversed3 = anIdx[0] < anIdx[2];
// Edges can be skipped in case of mesh defects - topologically or geometrically
// degenerated triangles.
const Standard_Boolean aHasAllEdges = anEdgeToTEgeMap.Contains(aMeshEdge1) &&
anEdgeToTEgeMap.Contains(aMeshEdge2) &&
anEdgeToTEgeMap.Contains(aMeshEdge3) ;
if (!aHasAllEdges)
continue;
TopoDS_Edge aTEdge1 = anEdgeToTEgeMap.FindFromKey(aMeshEdge1);
if (isReversed1)
aTEdge1.Reverse();
TopoDS_Edge aTEdge2 = anEdgeToTEgeMap.FindFromKey(aMeshEdge2);
if (isReversed2)
aTEdge2.Reverse();
TopoDS_Edge aTEdge3 = anEdgeToTEgeMap.FindFromKey(aMeshEdge3);
if (isReversed3)
aTEdge3.Reverse();
BRepBuilderAPI_MakeWire aWireMaker;
aWireMaker.Add(aTEdge1);
aWireMaker.Add(aTEdge2);
aWireMaker.Add(aTEdge3);
const TopoDS_Wire aWire = aWireMaker.Wire();
// Construct plane explicitly since it is faster than automatic construction
// within BRepBuilderAPI_MakeFace.
BRepAdaptor_Curve aC1(aTEdge1);
BRepAdaptor_Curve aC2(aTEdge2);
const gp_Dir aD1 = aC1.Line().Direction();
const gp_Dir aD2 = aC2.Line().Direction();
gp_XYZ aN = aD1.XYZ().Crossed(aD2.XYZ());
if (aN.SquareModulus() < Precision::SquareConfusion())
continue;
if (aTEdge1.Orientation() == TopAbs_REVERSED)
aN.Reverse();
if (aTEdge2.Orientation() == TopAbs_REVERSED)
aN.Reverse();
const gp_Dir aNorm(aN);
gp_Pln aPln(myMesh->Node(anIdx[0]), aNorm);
BRepBuilderAPI_MakeFace aFaceMaker(aPln, aWire);
const TopoDS_Face aFace = aFaceMaker.Face();
aBB.Add(aResult, aFace);
}
this->Done();
myShape = aResult;
}

View File

@@ -1,46 +0,0 @@
// Created on: 2022-06-30
// Created by: Alexander MALYSHEV
// Copyright (c) 2022-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile
#define _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Poly_Triangulation.hxx>
//! Builds shape on per-facet basis on the input mesh. Resulting shape has shared
//! edges by construction, but no maximization (unify same domain) is applied.
//! No generation history is provided.
class BRepBuilderAPI_MakeShapeOnMesh : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Ctor. Sets mesh to process.
//! @param theMesh [in] - Mesh to construct shape for.
BRepBuilderAPI_MakeShapeOnMesh(const Handle(Poly_Triangulation)& theMesh)
: myMesh(theMesh)
{}
//! Builds shape on mesh.
Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
private:
Handle(Poly_Triangulation) myMesh;
};
#endif // _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile

View File

@@ -36,14 +36,13 @@ BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const gp_Trsf& T) :
//purpose :
//=======================================================================
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& theShape,
const gp_Trsf& theTrsf,
const Standard_Boolean theCopyGeom,
const Standard_Boolean theCopyMesh)
: myTrsf(theTrsf)
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& S,
const gp_Trsf& T,
const Standard_Boolean Copy) :
myTrsf(T)
{
myModification = new BRepTools_TrsfModification(theTrsf);
Perform(theShape, theCopyGeom, theCopyMesh);
myModification = new BRepTools_TrsfModification(T);
Perform(S,Copy);
}
@@ -53,21 +52,19 @@ BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& theSh
//purpose :
//=======================================================================
void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& theShape,
const Standard_Boolean theCopyGeom,
const Standard_Boolean theCopyMesh)
void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
myUseModif = theCopyGeom || myTrsf.IsNegative() || (Abs(Abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
myUseModif = Copy || myTrsf.IsNegative() || (Abs(Abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
if (myUseModif) {
Handle(BRepTools_TrsfModification) theModif =
Handle(BRepTools_TrsfModification)::DownCast(myModification);
theModif->Trsf() = myTrsf;
theModif->IsCopyMesh() = theCopyMesh;
DoModif(theShape, myModification);
DoModif(S,myModification);
}
else {
myLocation = myTrsf;
myShape = theShape.Moved(myLocation);
myShape = S.Moved(myLocation);
Done();
}

View File

@@ -50,37 +50,28 @@ public:
//! to define the shape to transform.
Standard_EXPORT BRepBuilderAPI_Transform(const gp_Trsf& T);
//! Creates a transformation from the gp_Trsf <theTrsf>, and
//! applies it to the shape <theShape>. If the transformation
//! Creates a transformation from the gp_Trsf <T>, and
//! applies it to the shape <S>. If the transformation
//! is direct and isometric (determinant = 1) and
//! <theCopyGeom> = Standard_False, the resulting shape is
//! <theShape> on which a new location has been set.
//! <Copy> = Standard_False, the resulting shape is
//! <S> on which a new location has been set.
//! Otherwise, the transformation is applied on a
//! duplication of <theShape>.
//! If <theCopyMesh> is true, the triangulation will be copied,
//! and the copy will be assigned to the result shape.
Standard_EXPORT BRepBuilderAPI_Transform(const TopoDS_Shape& theShape,
const gp_Trsf& theTrsf,
const Standard_Boolean theCopyGeom = Standard_False,
const Standard_Boolean theCopyMesh = Standard_False);
//! duplication of <S>.
Standard_EXPORT BRepBuilderAPI_Transform(const TopoDS_Shape& S, const gp_Trsf& T, const Standard_Boolean Copy = Standard_False);
//! Applies the geometric transformation defined at the
//! pplies the geometric transformation defined at the
//! time of construction of this framework to the shape S.
//! - If the transformation T is direct and isometric, in
//! other words, if the determinant of the vectorial part
//! of T is equal to 1., and if theCopyGeom equals false (the
//! of T is equal to 1., and if Copy equals false (the
//! default value), the resulting shape is the same as
//! the original but with a new location assigned to it.
//! - In all other cases, the transformation is applied to a duplicate of theShape.
//! - If theCopyMesh is true, the triangulation will be copied,
//! and the copy will be assigned to the result shape.
//! - In all other cases, the transformation is applied to a duplicate of S.
//! Use the function Shape to access the result.
//! Note: this framework can be reused to apply the same
//! geometric transformation to other shapes. You only
//! need to specify them by calling the function Perform again.
Standard_EXPORT void Perform (const TopoDS_Shape& theShape,
const Standard_Boolean theCopyGeom = Standard_False,
const Standard_Boolean theCopyMesh = Standard_False);
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
//! Returns the modified shape corresponding to <S>.
Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const Standard_OVERRIDE;

View File

@@ -26,8 +26,6 @@ BRepBuilderAPI_MakePolygon.cxx
BRepBuilderAPI_MakePolygon.hxx
BRepBuilderAPI_MakeShape.cxx
BRepBuilderAPI_MakeShape.hxx
BRepBuilderAPI_MakeShapeOnMesh.cxx
BRepBuilderAPI_MakeShapeOnMesh.hxx
BRepBuilderAPI_MakeShell.cxx
BRepBuilderAPI_MakeShell.hxx
BRepBuilderAPI_MakeSolid.cxx

View File

@@ -30,6 +30,7 @@
#include <TopoDS_Face.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <Precision.hxx>
#include <Bnd_SeqOfBox.hxx>
#include <BRepExtrema_UnCompatibleShape.hxx>
#include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx>

View File

@@ -81,7 +81,7 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
BRepAdaptor_Curve Curv(E);
Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv);
myExtCS.Perform(*HC, U1, U2);
myExtCS.Perform(HC->Curve(), U1, U2);
if(!myExtCS.IsDone())
return;

View File

@@ -987,8 +987,8 @@ Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
ASI1.Perform(scur);
Standard_Integer sens = 1;
if(ASI1.IsDone() && ASI1.NbPoints(1) >= 1) {
if(ASI1.Point(1, 1).Parameter() + Precision::Confusion() < 0. &&
ASI1.Point(1, ASI1.NbPoints(1)).Parameter() + Precision::Confusion() < 0.) {
if(ASI1.Point(1, 1).Parameter() < 0. &&
ASI1.Point(1, ASI1.NbPoints(1)).Parameter() < 0.) {
sens = -1;
}
}

View File

@@ -1585,7 +1585,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
NbSamples = 4;
gp_Pln FirstPlane;
PlaneOfWire(TopoDS::Wire(myWork(ideb)), FirstPlane);
gp_Pnt PrevBary = FirstPlane.Location();
gp_Pnt FirstBary = FirstPlane.Location();
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
for (i = ideb+1; i <= ifin; i++)
{
@@ -1596,10 +1596,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
gp_Pln CurPlane;
PlaneOfWire(aWire, CurPlane);
gp_Pnt CurBary = CurPlane.Location();
gp_Vec aVec(PrevBary, CurBary);
gp_Vec aVec(FirstBary, CurBary);
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
CurBary.Translate(-anOffsetProj); //projected current bary center
gp_Vec Offset(CurBary, PrevBary);
gp_Vec Offset(CurBary, FirstBary);
TopoDS_Wire newwire;
BRep_Builder BB;
@@ -1804,8 +1804,6 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
newwire.Closed( Standard_True );
newwire.Orientation( TopAbs_FORWARD );
myWork(i) = newwire;
PrevBary = CurBary;
}
#ifdef OCCT_DEBUG_EFV

View File

@@ -85,7 +85,6 @@
#include <TopTools_HArray2OfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
#include <stdio.h>
//#include <BRepFill_TrimCorner.hxx>
@@ -290,34 +289,6 @@ static Standard_Boolean CheckSameParameter
return Standard_True;
}
//=======================================================================
//function : CheckSameParameterExact
//purpose : Check a posteriori that sameparameter has worked correctly
// with exact calculation method of edge tolerance
//=======================================================================
static Standard_Boolean CheckSameParameterExact
(const Handle(Adaptor3d_Curve)& C3d,
const Handle(Adaptor3d_CurveOnSurface)& curveOnSurface,
const Standard_Real tol3d,
Standard_Real& tolreached)
{
GeomLib_CheckCurveOnSurface aCheckCurveOnSurface(C3d);
aCheckCurveOnSurface.SetParallel(Standard_False);
aCheckCurveOnSurface.Perform(curveOnSurface);
tolreached = aCheckCurveOnSurface.MaxDistance();
if (tolreached > tol3d) {
return Standard_False;
}
else
{
tolreached = Max(tolreached, Precision::Confusion());
tolreached *= 1.05;
}
return Standard_True;
}
//=======================================================================
//function : SameParameter
//purpose : Encapsulation of Sameparameter
@@ -369,10 +340,8 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
return Standard_False;
}
Handle(Adaptor3d_Curve) curve3d = sp.Curve3d();
Handle(Adaptor3d_CurveOnSurface) curveOnSurface = sp.CurveOnSurface();
if (!CheckSameParameterExact(curve3d, curveOnSurface, tol3d, ResTol) && ResTol > tolreached) {
ResTol = sp.TolReached();
if(ResTol > tolreached ){
#ifdef OCCT_DEBUG
std::cout<<"SameParameter : Tolerance not reached!"<<std::endl;
std::cout<<"tol visee : "<<tol3d<<" tol obtained : "<<ResTol<<std::endl;
@@ -892,8 +861,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
Prof2 = BRep_Tool::Curve(E2, f2, l2);
// Indeed, both Prof1 and Prof2 are the same curves but in different positions
// Prof1's param domain may equals to Prof2's param domain *(-1), which means EF.Orientation() == EL.Orientation()
Standard_Boolean bSameCurveDomain = EF.Orientation() != EL.Orientation();
gp_Pnt P1, P2, P;
// Choose the angle of opening
@@ -919,8 +887,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
}
}
const Standard_Real aPrm2[] = { f2, 0.5*(f2 + l2), l2 };
const gp_Pnt aP2 = Prof2->Value(aPrm2[bSameCurveDomain ? aMaxIdx : 2 - aMaxIdx]).Transformed(aTf);
const gp_Pnt aP2 = Prof2->Value(aPrm[aMaxIdx]).Transformed(aTf);
const gp_Vec2d aV1(aP1[aMaxIdx].Z(), aP1[aMaxIdx].X());
const gp_Vec2d aV2(aP2.Z(), aP2.X());
if (aV1.SquareMagnitude() <= gp::Resolution() ||
@@ -3284,7 +3251,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
Tang = T1 + T2; //Average direction
gp_Dir NormalOfBisPlane = Tang;
gp_Vec anIntersectPointCrossDirection = T1.Crossed(T2);
if (isTangent) {
Sortant -= Tang.Dot(Tang)*Tang;
}
@@ -3331,7 +3298,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
}
}
BRepFill_TrimShellCorner aTrim(aFaces, Transition, AxeOfBisPlane, anIntersectPointCrossDirection);
BRepFill_TrimShellCorner aTrim(aFaces, Transition, AxeOfBisPlane);
aTrim.AddBounds(Bounds);
aTrim.AddUEdges(aUEdges);
aTrim.AddVEdges(myVEdges, Index);

View File

@@ -76,14 +76,12 @@ static Standard_Boolean FindCommonVertex(const TopoDS_Edge& theFirstEdge,
static Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
const Standard_Integer theEIndex1,
const Standard_Integer theEIndex2,
const gp_Vec& theCrossDirection,
TopoDS_Vertex& theCommonVertex,
Standard_Real& theParamOnE1,
Standard_Real& theParamOnE2);
static Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges,
const BOPDS_PDS& theDS,
const gp_Vec& theCrossDirection,
TopTools_DataMapOfShapeListOfShape& theHistMap);
static void StoreVedgeInHistMap(const Handle(TopTools_HArray1OfShape)& theVEdges,
@@ -196,11 +194,9 @@ static void UpdateSectionEdge(TopoDS_Edge& theEdge,
// ===========================================================================================
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
const BRepFill_TransitionStyle theTransition,
const gp_Ax2& theAxeOfBisPlane,
const gp_Vec& theIntPointCrossDir) :
const gp_Ax2& theAxeOfBisPlane) :
myTransition(theTransition),
myAxeOfBisPlane(theAxeOfBisPlane),
myIntPointCrossDir(theIntPointCrossDir),
myDone(Standard_False),
myHasSection(Standard_False)
{
@@ -313,7 +309,7 @@ void BRepFill_TrimShellCorner::Perform()
BOPDS_VectorOfInterfFF& aFFs = theDS->InterfFF();
Standard_Integer aNbFFs = aFFs.Length();
if(!SplitUEdges(myUEdges, theDS, myIntPointCrossDir, myHistMap)) {
if(!SplitUEdges(myUEdges, theDS, myHistMap)) {
return;
}
@@ -429,7 +425,7 @@ BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer
Standard_Real apar1 = 0., apar2 = 0.;
Standard_Boolean bvertexfound =
FindCommonVertex(theDS, anIndex1, anIndex2, myIntPointCrossDir, aCommonVertex, apar1, apar2);
FindCommonVertex(theDS, anIndex1, anIndex2, aCommonVertex, apar1, apar2);
// search common vertex between bounds. end
Handle(BRepTools_ReShape) aSubstitutor = new BRepTools_ReShape();
@@ -701,9 +697,9 @@ BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer
TopoDS_Vertex FirstVertex, LastVertex;
Standard_Real ParamOnLeftE1, ParamOnLeftE2, ParamOnRightE1, ParamOnRightE2;
FindCommonVertex(theDS, IndexOfLeftE1, IndexOfLeftE2, myIntPointCrossDir,
FindCommonVertex(theDS, IndexOfLeftE1, IndexOfLeftE2,
FirstVertex, ParamOnLeftE1, ParamOnLeftE2);
FindCommonVertex(theDS, IndexOfRightE1, IndexOfRightE2, myIntPointCrossDir,
FindCommonVertex(theDS, IndexOfRightE1, IndexOfRightE2,
LastVertex, ParamOnRightE1, ParamOnRightE2);
TopoDS_Shape SecWire;
@@ -1083,8 +1079,7 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
// purpose:
// ------------------------------------------------------------------------------------------
Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges,
const BOPDS_PDS& theDS,
const gp_Vec& theCrossDirection,
const BOPDS_PDS& theDS,
TopTools_DataMapOfShapeListOfShape& theHistMap) {
const BOPDS_VectorOfInterfVV& aVVs = theDS->InterfVV();
@@ -1110,7 +1105,7 @@ Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdge
TopoDS_Vertex aCommonVertex;
Standard_Real apar1 = 0., apar2 = 0.;
Standard_Boolean bvertexfound =
FindCommonVertex(theDS, anEIndex1, anEIndex2, theCrossDirection, aCommonVertex, apar1, apar2);
FindCommonVertex(theDS, anEIndex1, anEIndex2, aCommonVertex, apar1, apar2);
//
if(!bvertexfound) {
TopoDS_Vertex V1 = TopExp::LastVertex(TopoDS::Edge(aE1));
@@ -1222,7 +1217,6 @@ void FindFreeVertices(const TopoDS_Shape& theShape,
Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
const Standard_Integer theEIndex1,
const Standard_Integer theEIndex2,
const gp_Vec& theCrossDirection,
TopoDS_Vertex& theCommonVertex,
Standard_Real& theParamOnE1,
Standard_Real& theParamOnE2) {
@@ -1233,10 +1227,6 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
TopoDS_Vertex aCommonVertex;
Standard_Integer eeit = 0;
TopoDS_Edge theE1 = TopoDS::Edge(theDS->Shape(theEIndex1));
TopoDS_Edge theE2 = TopoDS::Edge(theDS->Shape(theEIndex2));
BRepAdaptor_Curve aBC1(theE1), aBC2(theE2);
Standard_Integer aNbEEs;
aNbEEs = aEEs.Length();
for(eeit = 0; eeit < aNbEEs; ++eeit) {
@@ -1257,21 +1247,10 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
IntTools_Tools::VertexParameters(aCP, theParamOnE1, theParamOnE2);
else
IntTools_Tools::VertexParameters(aCP, theParamOnE2, theParamOnE1);
gp_Pnt aPt;
gp_Vec aDirOnE1, aDirOnE2;
gp_Dir aIntersectPointCrossDir;
// intersect point aDirOnE1.cross(aDirOnE2) should same direction with path theCrossDirection
aBC1.D1(theParamOnE1, aPt, aDirOnE1);
aBC2.D1(theParamOnE2, aPt, aDirOnE2);
aIntersectPointCrossDir = aDirOnE1.Crossed(aDirOnE2);
if (aIntersectPointCrossDir.Dot(theCrossDirection) > Precision::SquareConfusion())
{
bvertexfound = Standard_True;
break;
}
//
bvertexfound = Standard_True;
break;
}
}
}

View File

@@ -41,12 +41,9 @@ public:
//! Constructor: takes faces to intersect,
//! type of transition (it can be RightCorner or RoundCorner)
//! and axis of bisector plane
//! theIntersectPointCrossDirection : prev path direction at the origin point of theAxeOfBisPlane
//! cross next path direction at the origin point of theAxeOfBisPlane. used when EE has more than one vertices
Standard_EXPORT BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
const BRepFill_TransitionStyle theTransition,
const gp_Ax2& theAxeOfBisPlane,
const gp_Vec& theIntPointCrossDir);
const gp_Ax2& theAxeOfBisPlane);
Standard_EXPORT void AddBounds (const Handle(TopTools_HArray2OfShape)& Bounds);
@@ -95,7 +92,6 @@ private:
BRepFill_TransitionStyle myTransition;
gp_Ax2 myAxeOfBisPlane;
gp_Vec myIntPointCrossDir;
TopoDS_Shape myShape1;
TopoDS_Shape myShape2;
Handle(TopTools_HArray2OfShape) myBounds;

View File

@@ -1960,12 +1960,6 @@ public:
return aDeriv.Transformed(mySurfaceTrsf);
}
gp_Dir Normal()
{
gp_Dir aNormal = mySurfaceProps.Normal();
return aNormal.Transformed(mySurfaceTrsf);
}
// Calculate principal curvatures, which consist of minimal and maximal normal curvatures and
// the directions on the tangent plane (principal direction) where the extremums are reached
void Curvature(gp_Dir& thePrincipalDir1, Standard_Real& theCurvature1,
@@ -2004,63 +1998,32 @@ private:
//purpose : check the angle at the border between two squares.
// Two shares should have a shared front edge.
//=======================================================================
GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const Standard_Real theAngleTol)
static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
const TopoDS_Face& F1,
const TopoDS_Face& F2,
const Standard_Real theAngleTol)
{
Standard_Boolean isSeam = theFace1.IsEqual(theFace2);
Standard_Boolean isSeam = F1.IsEqual(F2);
TopoDS_Edge anEdgeInFace1, anEdgeInFace2;
Handle(Geom2d_Curve) aCurve1, aCurve2;
Standard_Real aFirst, aLast;
if (!theFace1.IsSame (theFace2) &&
BRep_Tool::IsClosed (theEdge, theFace1) &&
BRep_Tool::IsClosed (theEdge, theFace2))
{
//Find the edge in the face 1: this edge will have correct orientation
TopoDS_Face aFace1 = theFace1;
aFace1.Orientation (TopAbs_FORWARD);
TopExp_Explorer anExplo (aFace1, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
if (anEdge.IsSame (theEdge))
{
anEdgeInFace1 = anEdge;
break;
}
}
if (anEdgeInFace1.IsNull())
return GeomAbs_C0;
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
TopoDS_Face aFace2 = theFace2;
aFace2.Orientation (TopAbs_FORWARD);
anEdgeInFace2 = anEdgeInFace1;
anEdgeInFace2.Reverse();
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, aFace2, aFirst, aLast);
}
else
{
// Obtaining of pcurves of edge on two faces.
anEdgeInFace1 = anEdgeInFace2 = theEdge;
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, theFace1, aFirst, aLast);
//For the case of seam edge
if (theFace1.IsSame(theFace2))
anEdgeInFace2.Reverse();
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, theFace2, aFirst, aLast);
}
TopoDS_Edge E = Ed;
if (aCurve1.IsNull() || aCurve2.IsNull())
// Check if pcurves exist on both faces of edge
Standard_Real aFirst,aLast;
E.Orientation(TopAbs_FORWARD);
Handle(Geom2d_Curve) aCurve1 = BRep_Tool::CurveOnSurface(E, F1, aFirst, aLast);
if(aCurve1.IsNull())
return GeomAbs_C0;
if (isSeam)
E.Orientation(TopAbs_REVERSED);
Handle(Geom2d_Curve) aCurve2 = BRep_Tool::CurveOnSurface(E, F2, aFirst, aLast);
if(aCurve2.IsNull())
return GeomAbs_C0;
TopLoc_Location aLoc1, aLoc2;
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface (theFace1, aLoc1);
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface(F1, aLoc1);
const gp_Trsf& aSurf1Trsf = aLoc1.Transformation();
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface (theFace2, aLoc2);
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface(F2, aLoc2);
const gp_Trsf& aSurf2Trsf = aLoc2.Transformation();
if (aSurface1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
@@ -2077,11 +2040,11 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
return GeomAbs_CN;
}
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, theFace1.Orientation() == TopAbs_REVERSED);
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, theFace2.Orientation() == TopAbs_REVERSED);
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, F1.Orientation() == TopAbs_REVERSED);
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, F2.Orientation() == TopAbs_REVERSED);
Standard_Real f, l, eps;
BRep_Tool::Range (theEdge,f,l);
BRep_Tool::Range(E,f,l);
Extrema_LocateExtPC ext;
Handle(BRepAdaptor_Curve) aHC2;
@@ -2092,6 +2055,7 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
const Standard_Real anAngleTol2 = theAngleTol * theAngleTol;
gp_Vec aDer1, aDer2;
gp_Vec aNorm1;
Standard_Real aSqLen1, aSqLen2;
gp_Dir aCrvDir1[2], aCrvDir2[2];
Standard_Real aCrvLen1[2], aCrvLen2[2];
@@ -2119,26 +2083,13 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
aDer2 = aSP2.Derivative();
aSqLen2 = aDer2.SquareMagnitude();
Standard_Boolean isSmoothSuspect = (aDer1.CrossSquareMagnitude(aDer2) <= anAngleTol2 * aSqLen1 * aSqLen2);
if (isSmoothSuspect)
{
gp_Dir aNormal1 = aSP1.Normal();
if (theFace1.Orientation() == TopAbs_REVERSED)
aNormal1.Reverse();
gp_Dir aNormal2 = aSP2.Normal();
if (theFace2.Orientation() == TopAbs_REVERSED)
aNormal2.Reverse();
if (aNormal1 * aNormal2 < 0.)
return GeomAbs_C0;
}
if (!isSmoothSuspect)
{
// Refine by projection
if (aHC2.IsNull())
{
// adaptor for pcurve on the second surface
aHC2 = new BRepAdaptor_Curve (anEdgeInFace2, theFace2);
aHC2 = new BRepAdaptor_Curve (E, F2);
ext.Initialize(*aHC2, f, l, Precision::PConfusion());
}
ext.Perform(aSP1.Value(), u);
@@ -2334,8 +2285,9 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
BRep_Builder B;
if(BRep_Tool::Continuity(E,F1,F2)<=GeomAbs_C0){
try {
GeomAbs_Shape aCont = ContinuityOfFaces(E, F1, F2, TolAng);
GeomAbs_Shape aCont = tgtfaces(E, F1, F2, TolAng);
B.Continuity(E,F1,F2,aCont);
}
catch(Standard_Failure const&)
{

View File

@@ -202,14 +202,7 @@ public:
//! orientation to have matter in the solid. Returns
//! False if the solid is unOrientable (open or incoherent)
Standard_EXPORT static Standard_Boolean OrientClosedSolid (TopoDS_Solid& solid);
//! Returns the order of continuity between two faces
//! connected by an edge
Standard_EXPORT static GeomAbs_Shape ContinuityOfFaces(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const Standard_Real theAngleTol);
//! Encodes the Regularity of edges on a Shape.
//! Warning: <TolAng> is an angular tolerance, expressed in Rad.
//! Warning: If the edges's regularity are coded before, nothing

View File

@@ -205,10 +205,10 @@ static void fillParams (const TColStd_Array1OfReal& theKnots,
theParams.Append (theParMax);
}
static void fillPoints (const BRepAdaptor_Curve& theCurve,
const NCollection_Vector<Standard_Real>& theParams,
TColgp_SequenceOfPnt& thePoints,
TColStd_SequenceOfReal& theWeights)
static void fillPoints (const BRepAdaptor_Curve& theCurve,
const NCollection_Vector<Standard_Real> theParams,
TColgp_SequenceOfPnt& thePoints,
TColStd_SequenceOfReal& theWeights)
{
Standard_Real aDistPrev = 0., aDistNext;
gp_Pnt aPPrev (theCurve.Value (theParams (0))), aPNext;

View File

@@ -124,12 +124,10 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(
const Standard_Real aDiffU = myRangeU.second - myRangeU.first;
const Standard_Real aDiffV = myRangeV.second - myRangeV.first;
// Slightly increase exact resolution so to cover links with approximate
// length equal to resolution itself on sub-resolution differences.
const Standard_Real aTolerance = BRep_Tool::Tolerance (myDFace->GetFace());
const Adaptor3d_Surface& aSurface = GetSurface()->Surface();
const Standard_Real aResU = aSurface.UResolution (aTolerance) * 1.1;
const Standard_Real aResV = aSurface.VResolution (aTolerance) * 1.1;
const Standard_Real aResU = aSurface.UResolution (aTolerance);
const Standard_Real aResV = aSurface.VResolution (aTolerance);
const Standard_Real aDeflectionUV = 1.e-05;
myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU);

View File

@@ -48,7 +48,8 @@ BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh( const TopoDS_Shape& theSh
const Standard_Real theLinDeflection,
const Standard_Boolean isRelative,
const Standard_Real theAngDeflection,
const Standard_Boolean isInParallel)
const Standard_Boolean isInParallel,
const Message_ProgressRange& theRange)
: myModified(Standard_False),
myStatus(IMeshData_NoError)
{
@@ -58,7 +59,7 @@ BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh( const TopoDS_Shape& theSh
myParameters.InParallel = isInParallel;
myShape = theShape;
Perform();
Perform(theRange);
}
//=======================================================================

View File

@@ -43,7 +43,8 @@ public: //! @name mesher API
const Standard_Real theLinDeflection,
const Standard_Boolean isRelative = Standard_False,
const Standard_Real theAngDeflection = 0.5,
const Standard_Boolean isInParallel = Standard_False);
const Standard_Boolean isInParallel = Standard_False,
const Message_ProgressRange& theRange = Message_ProgressRange());
//! Constructor.
//! Automatically calls method Perform.

View File

@@ -46,8 +46,7 @@ namespace
void operator()(const Standard_Integer theFaceIndex) const
{
const IMeshData::IFaceHandle& aDFace = myModel->GetFace(theFaceIndex);
if (aDFace->IsSet(IMeshData_Outdated) ||
aDFace->GetFace().IsNull())
if (aDFace->IsSet(IMeshData_Outdated))
{
return;
}
@@ -120,7 +119,7 @@ namespace
void operator()(const Standard_Integer theFaceIndex) const
{
const IMeshData::IFaceHandle& aDFace = myModel->GetFace(theFaceIndex);
if (aDFace->GetSurface()->GetType() != GeomAbs_Cone || aDFace->IsSet(IMeshData_Failure))
if (aDFace->GetSurface()->GetType() != GeomAbs_Cone)
{
return;
}
@@ -129,7 +128,7 @@ namespace
for (Standard_Integer aEdgeIdx = 0; aEdgeIdx < aDWire->EdgesNb() - 1; ++aEdgeIdx)
{
const IMeshData::IEdgePtr& aDEdge = aDWire->GetEdge (aEdgeIdx);
if (aDEdge->GetPCurve(aDFace.get(), TopAbs_FORWARD) != aDEdge->GetPCurve(aDFace.get(), TopAbs_REVERSED))
{
if (aDEdge->GetCurve()->ParametersNb() == 2)
@@ -147,7 +146,7 @@ namespace
}
}
return;
}
}
}
}

View File

@@ -29,7 +29,7 @@
//purpose :
//=======================================================================
static Handle(Geom2d_Curve) Project(const Handle(Geom_Curve)& M,
const gp_Ax3& Axis)
const gp_Ax3 Axis)
{
Handle(Geom2d_Curve) C;
C = GeomProjLib::Curve2d(M,new Geom_Plane(Axis));

View File

@@ -37,7 +37,7 @@ BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
const TopoDS_Shape& aGenShape,
const Sweep_NumShape& aDirShape):
myBuilder(aBuilder),
myBuilder(aBuilder),
myGenShape(aGenShape),
myDirWire(aDirShape),

View File

@@ -124,14 +124,7 @@ static Standard_Integer transform(Draw_Interpretor&,Standard_Integer n,const cha
Standard_Boolean isBasic = Standard_False;
Standard_Boolean isForced = Standard_False;
Standard_Boolean isCopy = Standard_False;
Standard_Boolean isCopyMesh = Standard_False;
// Check "copymesh" flag.
if (!strcmp(a[n - 1], "-copymesh"))
{
isCopyMesh = Standard_True;
last = --n;
}
// Check "copy" flag.
if (!strcmp(a[n-1], "-copy")) {
isCopy = Standard_True;
@@ -225,7 +218,7 @@ static Standard_Integer transform(Draw_Interpretor&,Standard_Integer n,const cha
return 1;
}
else {
trf.Perform(S, isCopy, isCopyMesh);
trf.Perform(S, isCopy);
if (!trf.IsDone())
return 1;
DBRep::Set(a[i],trf.Shape());
@@ -1494,27 +1487,27 @@ void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
transform,g);
theCommands.Add("tmove",
"tmove name1 name2 ... name, set location from name [-copy] [-copymesh]",
"tmove name1 name2 ... name, set location from name [-copy]",
__FILE__,
transform,g);
theCommands.Add("ttranslate",
"ttranslate name1 name2 ... dx dy dz [-copy [-copymesh]]",
"ttranslate name1 name2 ... dx dy dz [-copy]",
__FILE__,
transform,g);
theCommands.Add("trotate",
"trotate name1 name2 ... x y z dx dy dz angle [-copy [-copymesh]]",
"trotate name1 name2 ... x y z dx dy dz angle [-copy]",
__FILE__,
transform,g);
theCommands.Add("tmirror",
"tmirror name x y z dx dy dz [-copy] [-copymesh]",
"tmirror name x y z dx dy dz [-copy]",
__FILE__,
transform,g);
theCommands.Add("tscale",
"tscale name x y z scale [-copy] [-copymesh]",
"tscale name x y z scale [-copy]",
__FILE__,
transform,g);

View File

@@ -42,7 +42,6 @@
#include <LocOpe_FindEdgesInFace.hxx>
#include <BRepOffset_MakeOffset.hxx>
#include <BRepOffsetAPI_MakeOffsetShape.hxx>
#include <BRepOffset_MakeSimpleOffset.hxx>
#include <BRep_Builder.hxx>
#include <DBRep.hxx>
@@ -977,81 +976,6 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
return 0;
}
//=======================================================================
//function : mkoffsetshape
//purpose :
//=======================================================================
static Standard_Integer mkoffsetshape(Draw_Interpretor& theDI,
Standard_Integer theArgNb,
const char** theArgVec)
{
if (theArgNb < 4)
{
return 0;
}
TopoDS_Shape aShape = DBRep::Get(theArgVec[2]);
if (aShape.IsNull())
{
theDI << "Shape is null";
return 1;
}
Standard_Real anOffVal = Draw::Atof(theArgVec[3]);
BRepOffsetAPI_MakeOffsetShape aMaker;
if (theArgNb == 4)
{
aMaker.PerformBySimple(aShape, anOffVal);
}
else
{
Standard_Real aTol = Draw::Atof(theArgVec[4]);
Standard_Boolean anInt = Standard_False;
if (theArgNb > 5)
{
if ((Draw::Atof(theArgVec[5]) == 1))
{
anInt = Standard_True;
}
}
Standard_Boolean aSelfInt = Standard_False;
if (theArgNb > 6)
{
if (Draw::Atof(theArgVec[6]) == 1)
{
aSelfInt = Standard_True;
}
}
GeomAbs_JoinType aJoin = GeomAbs_Arc;
if (theArgNb > 7)
{
if (!strcmp(theArgVec[7], "i"))
{
aJoin = GeomAbs_Intersection;
}
}
Standard_Boolean aRemIntEdges = Standard_False;
if (theArgNb > 8)
{
if (Draw::Atof(theArgVec[8]) == 1)
{
aRemIntEdges = Standard_True;
}
}
aMaker.PerformByJoin(aShape, anOffVal, aTol, BRepOffset_Skin, anInt, aSelfInt, aJoin, aRemIntEdges);
}
if (!aMaker.IsDone())
{
theDI << " Error: Offset is not done.\n";
return 1;
}
DBRep::Set(theArgVec[1], aMaker.Shape());
return 0;
}
//=======================================================================
//function : offsetshape
//purpose :
@@ -2553,10 +2477,6 @@ void BRepTest::FeatureCommands(Draw_Interpretor& theCommands)
"thickshell r shape offset [jointype [tol] ]",
__FILE__, thickshell, g);
theCommands.Add("mkoffsetshape",
"mkoffsetshape r shape offset [Tol] [Intersection(0/1)] [SelfInter(0/1)] [JoinType(a/i)] [RemoveInternalEdges(0/1)]",
__FILE__, mkoffsetshape, g);
theCommands.Add("offsetshape",
"offsetshape r shape offset [tol] [face ...]",
__FILE__, offsetshape, g);

View File

@@ -57,7 +57,6 @@ static BRepOffsetAPI_ThruSections* Generator = 0;
#include <Geom_Circle.hxx>
#include <gp_Ax2.hxx>
#include <Message.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
//=======================================================================
// prism
@@ -534,50 +533,16 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char*
//=======================================================================
// mksweep
//=======================================================================
static Standard_Integer mksweep(Draw_Interpretor& di,
static Standard_Integer mksweep(Draw_Interpretor&,
Standard_Integer n, const char** a)
{
if (n != 2 && n != 5) return 1;
if (n != 2) return 1;
TopoDS_Shape Spine = DBRep::Get(a[1], TopAbs_WIRE);
if (Spine.IsNull()) return 1;
if (Sweep != 0) {
delete Sweep;
Sweep = 0;
}
if (n > 2 && n <= 5)
{
if (!strcmp(a[2], "-C"))
{
ShapeUpgrade_UnifySameDomain aUnif(Spine, Standard_True, Standard_False, Standard_True);
Standard_Real anAngTol = 5.;
Standard_Real aLinTol = 0.1;
if (n == 5)
{
anAngTol = Draw::Atof(a[3]);
aLinTol = Draw::Atof(a[4]);
}
aUnif.SetAngularTolerance(anAngTol * M_PI / 180.);
aUnif.SetLinearTolerance(aLinTol);
aUnif.Build();
Spine = aUnif.Shape();
if (BRepTest_Objects::IsHistoryNeeded())
{
BRepTest_Objects::SetHistory(aUnif.History());
}
}
else
{
di << "To correct input spine use 'mksweep wire -C [AngTol LinTol]'\n";
di << "By default, AngTol = 5, LinTol = 0.1";
return 1;
}
}
Sweep = new BRepOffsetAPI_MakePipeShell(TopoDS::Wire(Spine));
return 0;
}
@@ -1045,9 +1010,7 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
"\t\t-safe option allows to prevent the modifying of input shapes",
__FILE__, thrusections, g);
theCommands.Add("mksweep", "mksweep wire [-C [AngTol LinTol]]\n"
"\t\tthe option -C correct input spine by merging smooth connected neighboring edges\n"
"\t\tthe AngTol is in degrees",
theCommands.Add("mksweep", "mksweep wire",
__FILE__, mksweep, g);
theCommands.Add("setsweep", "setsweep no args to get help",

View File

@@ -695,7 +695,7 @@ Standard_Boolean BRepTools::Write (const TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress)
{
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out);
if (aStream.get() == NULL || !aStream->good())
{
return Standard_False;
@@ -893,8 +893,6 @@ void BRepTools::CleanGeometry(const TopoDS_Shape& theShape)
aBuilder.UpdateEdge(anEdge, Handle(Geom_Curve)(),
TopLoc_Location(), BRep_Tool::Tolerance(anEdge));
}
RemoveUnusedPCurves(theShape);
}

View File

@@ -1,215 +0,0 @@
// Copyright (c) 1999-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepTools_CopyModification.hxx>
#include <BRep_Tool.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepTools_CopyModification, BRepTools_Modification)
//=======================================================================
//function : BRepTools_CopyModification
//purpose :
//=======================================================================
BRepTools_CopyModification::BRepTools_CopyModification(const Standard_Boolean copyGeom,
const Standard_Boolean copyMesh)
: myCopyGeom(copyGeom),
myCopyMesh(copyMesh)
{
}
//=======================================================================
//function : NewSurface
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewSurface(const TopoDS_Face& theFace,
Handle(Geom_Surface)& theSurf,
TopLoc_Location& theLoc,
Standard_Real& theTol,
Standard_Boolean& theRevWires,
Standard_Boolean& theRevFace)
{
theSurf = BRep_Tool::Surface(theFace, theLoc);
theTol = BRep_Tool::Tolerance(theFace);
theRevWires = theRevFace = Standard_False;
if (!theSurf.IsNull() && myCopyGeom)
theSurf = Handle(Geom_Surface)::DownCast(theSurf->Copy());
return Standard_True;
}
//=======================================================================
//function : NewTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewTriangulation(const TopoDS_Face& theFace,
Handle(Poly_Triangulation)& theTri)
{
if (!myCopyMesh && BRep_Tool::IsGeometric(theFace))
{
return Standard_False;
}
TopLoc_Location aLoc;
theTri = BRep_Tool::Triangulation(theFace, aLoc);
if (theTri.IsNull())
return Standard_False;
// mesh is copied if and only if the geometry need to be copied too
if (myCopyGeom)
theTri = theTri->Copy();
return Standard_True;
}
//=======================================================================
//function : NewCurve
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewCurve(const TopoDS_Edge& theEdge,
Handle(Geom_Curve)& theCurve,
TopLoc_Location& theLoc,
Standard_Real& theTol)
{
Standard_Real aFirst, aLast;
theCurve = BRep_Tool::Curve(theEdge, theLoc, aFirst, aLast);
theTol = BRep_Tool::Tolerance(theEdge);
if (!theCurve.IsNull() && myCopyGeom)
theCurve = Handle(Geom_Curve)::DownCast(theCurve->Copy());
return Standard_True;
}
//=======================================================================
//function : NewPolygon
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewPolygon(const TopoDS_Edge& theEdge,
Handle(Poly_Polygon3D)& thePoly)
{
if (!myCopyMesh && BRep_Tool::IsGeometric(theEdge))
{
return Standard_False;
}
TopLoc_Location aLoc;
thePoly = BRep_Tool::Polygon3D(theEdge, aLoc);
if (thePoly.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
thePoly = thePoly->Copy();
return Standard_True;
}
//=======================================================================
//function : NewPolygonOnTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewPolygonOnTriangulation(
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly)
{
if (!myCopyMesh && BRep_Tool::IsGeometric(theEdge))
{
return Standard_False;
}
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(theFace, aLoc);
thePoly = BRep_Tool::PolygonOnTriangulation(theEdge, aTria, aLoc);
if (thePoly.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
thePoly = thePoly->Copy();
return Standard_True;
}
//=======================================================================
//function : NewPoint
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewPoint(const TopoDS_Vertex& theVertex,
gp_Pnt& thePnt,
Standard_Real& theTol)
{
thePnt = BRep_Tool::Pnt(theVertex);
theTol = BRep_Tool::Tolerance(theVertex);
return Standard_True;
}
//=======================================================================
//function : NewCurve2d
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewCurve2d(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
const TopoDS_Edge&,
const TopoDS_Face&,
Handle(Geom2d_Curve)& theCurve,
Standard_Real& theTol)
{
theTol = BRep_Tool::Tolerance(theEdge);
Standard_Real aFirst, aLast;
theCurve = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast);
if (!theCurve.IsNull() && myCopyGeom)
theCurve = Handle(Geom2d_Curve)::DownCast(theCurve->Copy());
return Standard_True;
}
//=======================================================================
//function : NewParameter
//purpose :
//=======================================================================
Standard_Boolean BRepTools_CopyModification::NewParameter(const TopoDS_Vertex& theVertex,
const TopoDS_Edge& theEdge,
Standard_Real& thePnt,
Standard_Real& theTol)
{
if (theVertex.IsNull())
return Standard_False; // infinite edge may have Null vertex
theTol = BRep_Tool::Tolerance(theVertex);
thePnt = BRep_Tool::Parameter(theVertex, theEdge);
return Standard_True;
}
//=======================================================================
//function : Continuity
//purpose :
//=======================================================================
GeomAbs_Shape BRepTools_CopyModification::Continuity(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const TopoDS_Edge&,
const TopoDS_Face&,
const TopoDS_Face&)
{
return BRep_Tool::Continuity(theEdge, theFace1, theFace2);
}

View File

@@ -1,124 +0,0 @@
// Copyright (c) 1999-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepTools_CopyModification_HeaderFile
#define _BRepTools_CopyModification_HeaderFile
#include <BRepTools_Modification.hxx>
class BRepTools_CopyModification;
DEFINE_STANDARD_HANDLE(BRepTools_CopyModification, BRepTools_Modification)
//! Tool class implementing necessary functionality for copying geometry and triangulation.
class BRepTools_CopyModification : public BRepTools_Modification
{
public:
//! Constructor.
//! \param[in] theCopyGeom indicates that the geomtery (surfaces and curves) should be copied
//! \param[in] theCopyMesh indicates that the triangulation should be copied
Standard_EXPORT explicit BRepTools_CopyModification(const Standard_Boolean theCopyGeom = Standard_True,
const Standard_Boolean theCopyMesh = Standard_True);
//! Returns true if theFace has been modified.
//! If the face has been modified:
//! - theSurf is the new geometry of the face,
//! - theLoc is its new location, and
//! - theTol is the new tolerance.
//! theRevWires, theRevFace are always set to false, because the orientaion is not changed.
Standard_EXPORT Standard_Boolean NewSurface(const TopoDS_Face& theFace,
Handle(Geom_Surface)& theSurf,
TopLoc_Location& theLoc,
Standard_Real& theTol,
Standard_Boolean& theRevWires,
Standard_Boolean& theRevFace) Standard_OVERRIDE;
//! Returns true if theEdge has been modified.
//! If the edge has been modified:
//! - theCurve is the new geometric support of the edge,
//! - theLoc is the new location, and
//! - theTol is the new tolerance.
//! If the edge has not been modified, this function
//! returns false, and the values of theCurve, theLoc and theTol are not significant.
Standard_EXPORT Standard_Boolean NewCurve(const TopoDS_Edge& theEdge,
Handle(Geom_Curve)& theCurve,
TopLoc_Location& theLoc,
Standard_Real& theTol) Standard_OVERRIDE;
//! Returns true if theVertex has been modified.
//! If the vertex has been modified:
//! - thePnt is the new geometry of the vertex, and
//! - theTol is the new tolerance.
//! If the vertex has not been modified this function
//! returns false, and the values of thePnt and theTol are not significant.
Standard_EXPORT Standard_Boolean NewPoint(const TopoDS_Vertex& theVertex, gp_Pnt& thePnt, Standard_Real& theTol) Standard_OVERRIDE;
//! Returns true if theEdge has a new curve on surface on theFace.
//! If a new curve exists:
//! - theCurve is the new geometric support of the edge,
//! - theTol the new tolerance.
//! If no new curve exists, this function returns false, and
//! the values of theCurve and theTol are not significant.
Standard_EXPORT Standard_Boolean NewCurve2d(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
const TopoDS_Edge& theNewEdge,
const TopoDS_Face& theNewFace,
Handle(Geom2d_Curve)& theCurve,
Standard_Real& theTol) Standard_OVERRIDE;
//! Returns true if theVertex has a new parameter on theEdge.
//! If a new parameter exists:
//! - thePnt is the parameter, and
//! - theTol is the new tolerance.
//! If no new parameter exists, this function returns false,
//! and the values of thePnt and theTol are not significant.
Standard_EXPORT Standard_Boolean NewParameter(const TopoDS_Vertex& theVertex,
const TopoDS_Edge& theEdge,
Standard_Real& thePnt,
Standard_Real& theTol) Standard_OVERRIDE;
//! Returns the continuity of theNewEdge between theNewFace1 and theNewFace2.
//!
//! theNewEdge is the new edge created from theEdge. theNewFace1
//! (resp. theNewFace2) is the new face created from theFace1 (resp. theFace2).
Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const TopoDS_Edge& theNewEdge,
const TopoDS_Face& theNewFace1,
const TopoDS_Face& theNewFace2) Standard_OVERRIDE;
//! Returns true if the face has been modified according to changed triangulation.
//! If the face has been modified:
//! - theTri is a new triangulation on the face
Standard_EXPORT Standard_Boolean NewTriangulation(const TopoDS_Face& theFace, Handle(Poly_Triangulation)& theTri) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon.
//! If the edge has been modified:
//! - thePoly is a new polygon
Standard_EXPORT Standard_Boolean NewPolygon(const TopoDS_Edge& theEdge, Handle(Poly_Polygon3D)& thePoly) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon on triangulation.
//! If the edge has been modified:
//! - thePoly is a new polygon on triangulation
Standard_EXPORT Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BRepTools_CopyModification, BRepTools_Modification)
private:
Standard_Boolean myCopyGeom;
Standard_Boolean myCopyMesh;
};
#endif // _BRepTools_CopyModification_HeaderFile

View File

@@ -29,7 +29,6 @@
#include <GeomLib.hxx>
#include <gp_GTrsf.hxx>
#include <gp_Pnt.hxx>
#include <gp_Quaternion.hxx>
#include <gp_XYZ.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
@@ -89,13 +88,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewSurface
gp_GTrsf gtrsf;
gtrsf.SetVectorialPart(myGTrsf.VectorialPart());
gtrsf.SetTranslationPart(myGTrsf.TranslationPart());
S = BRep_Tool::Surface(F, L);
if (S.IsNull())
{
//processing the case when there is no geometry
return Standard_False;
}
S = Handle(Geom_Surface)::DownCast(S->Copy());
S = Handle(Geom_Surface)::DownCast(BRep_Tool::Surface(F,L)->Copy());
Tol = BRep_Tool::Tolerance(F);
Tol *= myGScale;
@@ -180,7 +173,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewCurve
C = new Geom_TrimmedCurve(C, f, l);
}
L.Identity() ;
return !C.IsNull();
return Standard_True;
}
//=======================================================================
@@ -221,11 +214,6 @@ Standard_Boolean BRepTools_GTrsfModification::NewCurve2d
Tol *= myGScale;
Standard_Real f,l;
C = BRep_Tool::CurveOnSurface(E,F,f,l);
if (C.IsNull())
{
//processing the case when there is no geometry
return Standard_False;
}
C = new Geom2d_TrimmedCurve(C, f, l);
return Standard_True;
}
@@ -263,113 +251,4 @@ GeomAbs_Shape BRepTools_GTrsfModification::Continuity
return BRep_Tool::Continuity(E,F1,F2);
}
//=======================================================================
//function : NewTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_GTrsfModification::NewTriangulation(const TopoDS_Face& theFace,
Handle(Poly_Triangulation)& theTriangulation)
{
TopLoc_Location aLoc;
theTriangulation = BRep_Tool::Triangulation(theFace, aLoc);
if (theTriangulation.IsNull())
{
return Standard_False;
}
gp_GTrsf aGTrsf;
aGTrsf.SetVectorialPart(myGTrsf.VectorialPart());
aGTrsf.SetTranslationPart(myGTrsf.TranslationPart());
aGTrsf.Multiply(aLoc.Transformation());
theTriangulation = theTriangulation->Copy();
theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box
theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myGScale));
// apply transformation to 3D nodes
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
{
gp_Pnt aP = theTriangulation->Node(anInd);
aGTrsf.Transforms(aP.ChangeCoord());
theTriangulation->SetNode(anInd, aP);
}
// modify triangles orientation in case of mirror transformation
if (myGScale < 0.0)
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
{
Poly_Triangle aTria = theTriangulation->Triangle(anInd);
Standard_Integer aN1, aN2, aN3;
aTria.Get(aN1, aN2, aN3);
aTria.Set(aN1, aN3, aN2);
theTriangulation->SetTriangle(anInd, aTria);
}
}
// modify normals
if (theTriangulation->HasNormals())
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
{
gp_Dir aNormal = theTriangulation->Normal(anInd);
aNormal.Transform(aGTrsf.Trsf());
theTriangulation->SetNormal(anInd, aNormal);
}
}
return Standard_True;
}
//=======================================================================
//function : NewPolygon
//purpose :
//=======================================================================
Standard_Boolean BRepTools_GTrsfModification::NewPolygon(const TopoDS_Edge& theEdge,
Handle(Poly_Polygon3D)& thePoly)
{
TopLoc_Location aLoc;
thePoly = BRep_Tool::Polygon3D(theEdge, aLoc);
if (thePoly.IsNull())
{
return Standard_False;
}
gp_GTrsf aGTrsf;
aGTrsf.SetVectorialPart(myGTrsf.VectorialPart());
aGTrsf.SetTranslationPart(myGTrsf.TranslationPart());
aGTrsf.Multiply(aLoc.Transformation());
thePoly = thePoly->Copy();
thePoly->Deflection(thePoly->Deflection() * Abs(myGScale));
// transform nodes
TColgp_Array1OfPnt& aNodesArray = thePoly->ChangeNodes();
for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId)
{
gp_Pnt& aP = aNodesArray.ChangeValue(anId);
aGTrsf.Transforms(aP.ChangeCoord());
}
return Standard_True;
}
//=======================================================================
//function : NewPolygonOnTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_GTrsfModification::NewPolygonOnTriangulation
(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly)
{
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(theFace, aLoc);
if (aT.IsNull())
{
return Standard_False;
}
thePoly = BRep_Tool::PolygonOnTriangulation(theEdge, aT, aLoc);
if (!thePoly.IsNull())
thePoly = thePoly->Copy();
return Standard_True;
}

View File

@@ -101,25 +101,6 @@ public:
//! (resp. <F2>).
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2) Standard_OVERRIDE;
//! Returns true if the face has been modified according to changed triangulation.
//! If the face has been modified:
//! - theTri is a new triangulation on the face
Standard_EXPORT Standard_Boolean NewTriangulation(const TopoDS_Face& theFace,
Handle(Poly_Triangulation)& theTri) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon.
//! If the edge has been modified:
//! - thePoly is a new polygon
Standard_EXPORT Standard_Boolean NewPolygon(const TopoDS_Edge& theEdge,
Handle(Poly_Polygon3D)& thePoly) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon on triangulation.
//! If the edge has been modified:
//! - thePoly is a new polygon on triangulation
Standard_EXPORT Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly) Standard_OVERRIDE;

View File

@@ -20,10 +20,7 @@
#include <BRep_TEdge.hxx>
#include <BRepTools.hxx>
#include <ElSLib.hxx>
#include <Extrema_ExtPC2d.hxx>
#include <Extrema_GenLocateExtPS.hxx>
#include <Extrema_LocateExtPC.hxx>
#include <Extrema_LocateExtPC2d.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
@@ -50,163 +47,30 @@
#include <TopLoc_Location.hxx>
#include <TopoDS_Edge.hxx>
#include <BRep_Builder.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepTools_NurbsConvertModification,BRepTools_CopyModification)
IMPLEMENT_STANDARD_RTTIEXT(BRepTools_NurbsConvertModification,BRepTools_Modification)
//
namespace
static void GeomLib_ChangeUBounds(Handle(Geom_BSplineSurface)& aSurface,
const Standard_Real newU1,
const Standard_Real newU2)
{
static void GeomLib_ChangeUBounds(Handle(Geom_BSplineSurface)& aSurface,
const Standard_Real newU1,
const Standard_Real newU2)
{
TColStd_Array1OfReal knots(1, aSurface->NbUKnots());
aSurface->UKnots(knots);
BSplCLib::Reparametrize(newU1, newU2, knots);
aSurface->SetUKnots(knots);
}
static void GeomLib_ChangeVBounds(Handle(Geom_BSplineSurface)& aSurface,
const Standard_Real newV1,
const Standard_Real newV2)
{
TColStd_Array1OfReal knots(1, aSurface->NbVKnots());
aSurface->VKnots(knots);
BSplCLib::Reparametrize(newV1, newV2, knots);
aSurface->SetVKnots(knots);
}
// find 3D curve from theEdge in theMap, and return the transformed curve or NULL
static Handle(Geom_Curve) newCurve(const TColStd_IndexedDataMapOfTransientTransient& theMap,
const TopoDS_Edge& theEdge,
Standard_Real& theFirst,
Standard_Real& theLast)
{
Handle(Geom_Curve) aNewCurve;
TopLoc_Location aLoc;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aLoc, theFirst, theLast);
if (!aCurve.IsNull() && theMap.Contains(aCurve))
{
aNewCurve = Handle(Geom_Curve)::DownCast(theMap.FindFromKey(aCurve));
aNewCurve = Handle(Geom_Curve)::DownCast(aNewCurve->Transformed(aLoc.Transformation()));
}
return aNewCurve;
}
// find 2D curve from theEdge on theFace in theMap, and return the transformed curve or NULL
static Handle(Geom2d_Curve) newCurve(const TColStd_IndexedDataMapOfTransientTransient& theMap,
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Standard_Real& theFirst,
Standard_Real& theLast)
{
Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, theFirst, theLast);
return (!aC2d.IsNull() && theMap.Contains(aC2d)) ? Handle(Geom2d_Curve)::DownCast(theMap.FindFromKey(aC2d))
: Handle(Geom2d_Curve)();
}
// find surface from theFace in theMap, and return the transformed surface or NULL
static Handle(Geom_Surface) newSurface(const TColStd_IndexedDataMapOfTransientTransient& theMap,
const TopoDS_Face& theFace)
{
Handle(Geom_Surface) aNewSurf;
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
if (!aSurf.IsNull() && theMap.Contains(aSurf))
{
aNewSurf = Handle(Geom_Surface)::DownCast(theMap.FindFromKey(aSurf));
aNewSurf = Handle(Geom_Surface)::DownCast(aNewSurf->Transformed(aLoc.Transformation()));
}
return aNewSurf;
}
static Standard_Boolean newParameter(const gp_Pnt& thePoint,
const Handle(Geom_Curve)& theCurve,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTol,
Standard_Real& theParam)
{
GeomAdaptor_Curve anAdaptor(theCurve);
Extrema_LocateExtPC proj(thePoint, anAdaptor, theParam, theFirst, theLast, Precision::PConfusion());
if (proj.IsDone())
{
Standard_Real aDist2Min = proj.SquareDistance();
if (aDist2Min < theTol * theTol)
{
theParam = proj.Point().Parameter();
return Standard_True;
}
}
return Standard_False;
}
static Standard_Boolean newParameter(const gp_Pnt2d& theUV,
const Handle(Geom2d_Curve)& theCurve2d,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTol,
Standard_Real& theParam)
{
Geom2dAdaptor_Curve anAdaptor(theCurve2d);
Extrema_LocateExtPC2d aProj(theUV, anAdaptor, theParam, Precision::PConfusion());
if (aProj.IsDone())
{
Standard_Real aDist2Min = aProj.SquareDistance();
if (aDist2Min < theTol * theTol)
{
theParam = aProj.Point().Parameter();
return Standard_True;
}
}
else
{
// Try to use general extrema to find the parameter, because Extrema_LocateExtPC2d
// sometimes could not find a solution if the parameter's first approach is several
// spans away from the expected solution (test bugs/modalg_7/bug28722).
Extrema_ExtPC2d anExt(theUV, anAdaptor, theFirst, theLast);
if (anExt.IsDone())
{
Standard_Integer aMinInd = 0;
Standard_Real aMinSqDist = Precision::Infinite();
for (Standard_Integer anIndex = 1; anIndex <= anExt.NbExt(); ++anIndex)
if (anExt.SquareDistance(anIndex) < aMinSqDist)
{
aMinSqDist = anExt.SquareDistance(anIndex);
aMinInd = anIndex;
}
if (aMinSqDist < theTol * theTol)
{
theParam = anExt.Point(aMinInd).Parameter();
return Standard_True;
}
}
}
return Standard_False;
}
static Standard_Boolean newUV(const gp_Pnt& thePoint,
const Handle(Geom_Surface)& theSurf,
const Standard_Real theTol,
gp_Pnt2d& theUV)
{
GeomAdaptor_Surface anAdaptor(theSurf);
Extrema_GenLocateExtPS aProj(anAdaptor);
aProj.Perform(thePoint, theUV.X(), theUV.Y());
if (aProj.IsDone())
{
Standard_Real aDist2Min = aProj.SquareDistance();
if (aDist2Min < theTol * theTol)
{
gp_XY& aUV = theUV.ChangeCoord();
aProj.Point().Parameter(aUV.ChangeCoord(1), aUV.ChangeCoord(2));
return Standard_True;
}
}
return Standard_False;
}
TColStd_Array1OfReal knots(1,aSurface->NbUKnots()) ;
aSurface->UKnots(knots) ;
BSplCLib::Reparametrize(newU1,
newU2,
knots) ;
aSurface->SetUKnots(knots) ;
}
static void GeomLib_ChangeVBounds(Handle(Geom_BSplineSurface)& aSurface,
const Standard_Real newV1,
const Standard_Real newV2)
{
TColStd_Array1OfReal knots(1,aSurface->NbVKnots()) ;
aSurface->VKnots(knots) ;
BSplCLib::Reparametrize(newV1,
newV2,
knots) ;
aSurface->SetVKnots(knots) ;
}
//=======================================================================
@@ -238,12 +102,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
RevWires = Standard_False;
RevFace = Standard_False;
Handle(Geom_Surface) SS = BRep_Tool::Surface(F,L);
if (SS.IsNull())
{
//processing the case when there is no geometry
return Standard_False;
}
Handle(Standard_Type) TheTypeSS = SS->DynamicType();
if ((TheTypeSS == STANDARD_TYPE(Geom_BSplineSurface)) ||
(TheTypeSS == STANDARD_TYPE(Geom_BezierSurface))) {
@@ -257,7 +115,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
//OCC466(apo)->
U1 = curvU1; U2 = curvU2;
V1 = curvV1; V2 = curvV2;
S->Bounds(surfU1,surfU2,surfV1,surfV2);
SS->Bounds(surfU1,surfU2,surfV1,surfV2);
if (Abs(U1 - surfU1) <= TolPar)
U1 = surfU1;
@@ -334,10 +192,10 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
if (Abs(surfU1-U1) > Tol || Abs(surfU2-U2) > Tol ||
Abs(surfV1-V1) > Tol || Abs(surfV2-V2) > Tol)
S = new Geom_RectangularTrimmedSurface(S, U1, U2, V1, V2);
S->Bounds(surfU1,surfU2,surfV1,surfV2);
SS = new Geom_RectangularTrimmedSurface(S, U1, U2, V1, V2);
SS->Bounds(surfU1,surfU2,surfV1,surfV2);
S = GeomConvert::SurfaceToBSplineSurface(S);
S = GeomConvert::SurfaceToBSplineSurface(SS);
Handle(Geom_BSplineSurface) BS = Handle(Geom_BSplineSurface)::DownCast(S) ;
BS->Resolution(Tol, UTol, VTol) ;
@@ -352,9 +210,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
GeomLib_ChangeVBounds(BS, V1, V2) ;
}
if (!myMap.Contains(SS)) {
myMap.Add(SS, S);
}
return Standard_True;
}
@@ -379,41 +234,6 @@ static Standard_Boolean IsConvert(const TopoDS_Edge& E)
}
//=======================================================================
//function : NewTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_NurbsConvertModification::NewTriangulation(const TopoDS_Face& theFace,
Handle(Poly_Triangulation)& theTri)
{
if (!BRepTools_CopyModification::NewTriangulation(theFace, theTri))
{
return Standard_False;
}
// convert UV nodes of the mesh
if (theTri->HasUVNodes())
{
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
Handle(Geom_Surface) aNewSurf = newSurface(myMap, theFace);
if (!aSurf.IsNull() && !aNewSurf.IsNull())
{
Standard_Real aTol = BRep_Tool::Tolerance(theFace);
for (Standard_Integer anInd = 1; anInd <= theTri->NbNodes(); ++anInd)
{
gp_Pnt2d aUV = theTri->UVNode(anInd);
gp_Pnt aPoint = aSurf->Value(aUV.X(), aUV.Y());
if (newUV(aPoint, aNewSurf, aTol, aUV))
theTri->SetUVNode(anInd, aUV);
}
}
}
return Standard_True;
}
//=======================================================================
//function : NewCurve
//purpose :
@@ -492,40 +312,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve
return Standard_True ;
}
//=======================================================================
//function : NewPolygon
//purpose :
//=======================================================================
Standard_Boolean BRepTools_NurbsConvertModification::NewPolygon(const TopoDS_Edge& theEdge,
Handle(Poly_Polygon3D)& thePoly)
{
if (!BRepTools_CopyModification::NewPolygon(theEdge, thePoly))
{
return Standard_False;
}
// update parameters of polygon
if (thePoly->HasParameters())
{
Standard_Real aTol = BRep_Tool::Tolerance(theEdge);
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast);
if (!aCurve.IsNull() && !aNewCurve.IsNull()) // skip processing degenerated edges
{
TColStd_Array1OfReal& aParams = thePoly->ChangeParameters();
for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd)
{
Standard_Real& aParam = aParams(anInd);
gp_Pnt aPoint = aCurve->Value(aParam);
newParameter(aPoint, aNewCurve, aFirst, aLast, aTol, aParam);
}
}
}
return Standard_True;
}
//=======================================================================
//function : NewPoint
//purpose :
@@ -554,7 +340,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = BRep_Tool::Tolerance(E);
Standard_Real f2d,l2d;
Handle(Geom2d_Curve) aBaseC2d = BRep_Tool::CurveOnSurface(E,F,f2d,l2d);
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E,F,f2d,l2d);
Standard_Real f3d,l3d;
TopLoc_Location Loc;
Handle(Geom_Curve) C3d = BRep_Tool::Curve(E, Loc, f3d,l3d);
@@ -562,7 +348,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
!C3d->IsKind(STANDARD_TYPE(Geom_BezierCurve))) ||
IsConvert(E));
Handle(Geom2d_Curve) C2d = aBaseC2d;
if(BRep_Tool::Degenerated(E)) {
//Curve2d = C2d;
if(!C2d->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
@@ -571,7 +356,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
C2d = aTrimC;
}
Curve2d = Geom2dConvert::CurveToBSplineCurve(C2d);
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
if(!BRepTools::IsReallyClosed(E,F)) {
@@ -597,11 +381,9 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
if(!newE.IsNull()) {
C3d = BRep_Tool::Curve(newE, f3d, l3d);
}
if (C3d.IsNull()) {
else {
C3d = BRep_Tool::Curve(E,f3d,l3d);
}
if (C3d.IsNull())
return Standard_False;
GeomAdaptor_Curve G3dAC(C3d, f3d, l3d);
Handle(GeomAdaptor_Curve) G3dAHC = new GeomAdaptor_Curve(G3dAC);
@@ -621,16 +403,13 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
return Standard_False;
}
}
else {
Handle(Geom_Surface) aNewS = BRep_Tool::Surface(newF);
if (!aNewS.IsNull())
S = aNewS;
S = BRep_Tool::Surface(newF);
}
S->Bounds(Uinf, Usup, Vinf, Vsup);
//Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
@@ -672,7 +451,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
Curve2d = ProjOnCurve.BSpline();
@@ -682,7 +460,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
@@ -725,7 +502,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
else {
@@ -736,7 +512,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
}
@@ -782,7 +557,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
return Standard_False;
@@ -808,7 +582,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
return Standard_False;
@@ -856,7 +629,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
Tol = newTol;
myUpdatedEdges.Append(newE);
}
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
else {
@@ -868,7 +640,6 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
myUpdatedEdges.Append(newE);
}
mylcu.Append(C2dBis);
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
}
@@ -880,58 +651,11 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
return Standard_False;
}
Curve2d = Geom2dConvert::CurveToBSplineCurve(C2d);
myMap.Add(aBaseC2d, Curve2d);
return Standard_True;
}
}
}
//=======================================================================
//function : NewPolygonOnTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation(
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly)
{
if (!BRepTools_CopyModification::NewPolygonOnTriangulation(theEdge, theFace, thePoly))
{
return Standard_False;
}
// update parameters of 2D polygon
if (thePoly->HasParameters())
{
Standard_Real aTol = Max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection());
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
Handle(Geom_Surface) aNewSurf = newSurface(myMap, theFace);
Standard_Real aFirst, aLast;
Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast);
Handle(Geom2d_Curve) aNewC2d = newCurve(myMap, theEdge, theFace, aFirst, aLast);
if (!aSurf.IsNull() && !aC2d.IsNull() && !aNewSurf.IsNull() && !aNewC2d.IsNull())
{
// compute 2D tolerance
GeomAdaptor_Surface aSurfAdapt(aSurf);
Standard_Real aTol2D = Max(aSurfAdapt.UResolution(aTol), aSurfAdapt.VResolution(aTol));
for (Standard_Integer anInd = 1; anInd <= thePoly->NbNodes(); ++anInd)
{
Standard_Real aParam = thePoly->Parameter(anInd);
gp_Pnt2d aUV = aC2d->Value(aParam);
gp_Pnt aPoint = aSurf->Value(aUV.X(), aUV.Y());
if (newUV(aPoint, aNewSurf, aTol, aUV) &&
newParameter(aUV, aNewC2d, aFirst, aLast, aTol2D, aParam))
{
thePoly->SetParameter(anInd, aParam);
}
}
}
}
return Standard_True;
}
//=======================================================================
//function : NewParameter
//purpose :
@@ -946,12 +670,30 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewParameter
Tol = BRep_Tool::Tolerance(V);
if(BRep_Tool::Degenerated(E))
return Standard_False;
Standard_Real f, l, param = BRep_Tool::Parameter(V,E);
TopLoc_Location L;
Handle(Geom_Curve) gc = BRep_Tool::Curve(E, L, f, l);
if(!myMap.Contains(gc))
return Standard_False;
Handle(Geom_BSplineCurve) gcc =
Handle(Geom_BSplineCurve)::DownCast(myMap.FindFromKey(gc));
gcc = Handle(Geom_BSplineCurve)::DownCast(gcc->Transformed(L.Transformation()));
GeomAdaptor_Curve ac(gcc);
gp_Pnt pnt = BRep_Tool::Pnt(V);
P = BRep_Tool::Parameter(V,E);
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aNewCurve = newCurve(myMap, E, aFirst, aLast);
return !aNewCurve.IsNull() && newParameter(pnt, aNewCurve, aFirst, aLast, Tol, P);
Extrema_LocateExtPC proj(pnt, ac, param, f, l, Tol);
if(proj.IsDone()) {
Standard_Real Dist2Min = proj.SquareDistance();
if (Dist2Min < Tol*Tol) {
P = proj.Point().Parameter();
return Standard_True;
}
}
return Standard_False;
}
//=======================================================================

View File

@@ -22,7 +22,7 @@
#include <TopTools_ListOfShape.hxx>
#include <TColStd_ListOfTransient.hxx>
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
#include <BRepTools_CopyModification.hxx>
#include <BRepTools_Modification.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
class TopoDS_Face;
@@ -36,12 +36,12 @@ class Geom2d_Curve;
class BRepTools_NurbsConvertModification;
DEFINE_STANDARD_HANDLE(BRepTools_NurbsConvertModification, BRepTools_CopyModification)
DEFINE_STANDARD_HANDLE(BRepTools_NurbsConvertModification, BRepTools_Modification)
//! Defines a modification of the geometry by a Trsf
//! from gp. All methods return True and transform the
//! geometry.
class BRepTools_NurbsConvertModification : public BRepTools_CopyModification
class BRepTools_NurbsConvertModification : public BRepTools_Modification
{
public:
@@ -100,27 +100,11 @@ public:
//! (resp. <F2>).
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2) Standard_OVERRIDE;
//! Returns true if the face has been modified according to changed triangulation.
//! If the face has been modified:
//! - theTri is a new triangulation on the face
Standard_EXPORT Standard_Boolean NewTriangulation(const TopoDS_Face& theFace, Handle(Poly_Triangulation)& theTri) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon.
//! If the edge has been modified:
//! - thePoly is a new polygon
Standard_EXPORT Standard_Boolean NewPolygon(const TopoDS_Edge& theEdge, Handle(Poly_Polygon3D)& thePoly) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon on triangulation.
//! If the edge has been modified:
//! - thePoly is a new polygon on triangulation
Standard_EXPORT Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
Handle(Poly_PolygonOnTriangulation)& thePoly) Standard_OVERRIDE;
Standard_EXPORT const TopTools_ListOfShape& GetUpdatedEdges() const;
DEFINE_STANDARD_RTTIEXT(BRepTools_NurbsConvertModification,BRepTools_CopyModification)
DEFINE_STANDARD_RTTIEXT(BRepTools_NurbsConvertModification,BRepTools_Modification)
protected:

View File

@@ -23,7 +23,6 @@
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomLib.hxx>
#include <GeomLib_Tool.hxx>
#include <gp_GTrsf2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
@@ -44,8 +43,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepTools_TrsfModification,BRepTools_Modification)
//purpose :
//=======================================================================
BRepTools_TrsfModification::BRepTools_TrsfModification(const gp_Trsf& T) :
myTrsf(T),
myCopyMesh(Standard_False)
myTrsf(T)
{
}
@@ -60,16 +58,6 @@ gp_Trsf& BRepTools_TrsfModification::Trsf ()
return myTrsf;
}
//=======================================================================
//function : IsCopyMesh
//purpose :
//=======================================================================
Standard_Boolean& BRepTools_TrsfModification::IsCopyMesh()
{
return myCopyMesh;
}
//=======================================================================
//function : NewSurface
//purpose :
@@ -84,12 +72,6 @@ Standard_Boolean BRepTools_TrsfModification::NewSurface
Standard_Boolean& RevFace)
{
S = BRep_Tool::Surface(F,L);
if (S.IsNull())
{
//processing cases when there is no geometry
return Standard_False;
}
Tol = BRep_Tool::Tolerance(F);
Tol *= Abs(myTrsf.ScaleFactor());
RevWires = Standard_False;
@@ -105,194 +87,6 @@ Standard_Boolean BRepTools_TrsfModification::NewSurface
return Standard_True;
}
//=======================================================================
//function : NewTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_TrsfModification::NewTriangulation
(const TopoDS_Face& theFace,
Handle(Poly_Triangulation)& theTriangulation)
{
if (!myCopyMesh)
{
return Standard_False;
}
TopLoc_Location aLoc;
theTriangulation = BRep_Tool::Triangulation(theFace, aLoc);
if (theTriangulation.IsNull())
{
return Standard_False;
}
gp_Trsf aTrsf = myTrsf;
if (!aLoc.IsIdentity())
{
aTrsf = aLoc.Transformation().Inverted() * aTrsf * aLoc.Transformation();
}
theTriangulation = theTriangulation->Copy();
theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box
theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myTrsf.ScaleFactor()));
// apply transformation to 3D nodes
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
{
gp_Pnt aP = theTriangulation->Node(anInd);
aP.Transform(aTrsf);
theTriangulation->SetNode(anInd, aP);
}
// modify 2D nodes
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
if (theTriangulation->HasUVNodes() && !aSurf.IsNull())
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
{
gp_Pnt2d aP2d = theTriangulation->UVNode(anInd);
aSurf->TransformParameters(aP2d.ChangeCoord().ChangeCoord(1),
aP2d.ChangeCoord().ChangeCoord(2),
myTrsf);
theTriangulation->SetUVNode(anInd, aP2d);
}
}
// modify triangles orientation in case of mirror transformation
if (myTrsf.ScaleFactor() < 0.0)
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
{
Poly_Triangle aTria = theTriangulation->Triangle(anInd);
Standard_Integer aN1, aN2, aN3;
aTria.Get(aN1, aN2, aN3);
aTria.Set(aN1, aN3, aN2);
theTriangulation->SetTriangle(anInd, aTria);
}
}
// modify normals
if (theTriangulation->HasNormals())
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
{
gp_Dir aNormal = theTriangulation->Normal(anInd);
aNormal.Transform(aTrsf);
theTriangulation->SetNormal(anInd, aNormal);
}
}
return Standard_True;
}
//=======================================================================
//function : NewPolygon
//purpose :
//=======================================================================
Standard_Boolean BRepTools_TrsfModification::NewPolygon
(const TopoDS_Edge& theE,
Handle(Poly_Polygon3D)& theP)
{
if (!myCopyMesh)
{
return Standard_False;
}
TopLoc_Location aLoc;
theP = BRep_Tool::Polygon3D(theE, aLoc);
if (theP.IsNull())
{
return Standard_False;
}
gp_Trsf aTrsf = myTrsf;
if (!aLoc.IsIdentity())
{
aTrsf = aLoc.Transformation().Inverted() * aTrsf * aLoc.Transformation();
}
theP = theP->Copy();
theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor()));
TColgp_Array1OfPnt& aNodesArray = theP->ChangeNodes();
for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId)
{
//Applying the transformation to each node of polygon
aNodesArray.ChangeValue(anId).Transform(aTrsf);
}
// transform the parametrization
if (theP->HasParameters())
{
TopLoc_Location aCurveLoc;
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theE, aCurveLoc, aFirst, aLast);
if (!aCurve.IsNull())
{
Standard_Real aReparametrization = aCurve->ParametricTransformation(aTrsf);
if (Abs(aReparametrization - 1.0) > Precision::PConfusion())
{
TColStd_Array1OfReal& aParams = theP->ChangeParameters();
for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd)
{
aParams(anInd) *= aReparametrization;
}
}
}
}
return Standard_True;
}
//=======================================================================
//function : NewPolygonOnTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools_TrsfModification::NewPolygonOnTriangulation
(const TopoDS_Edge& theE,
const TopoDS_Face& theF,
Handle(Poly_PolygonOnTriangulation)& theP)
{
if (!myCopyMesh)
{
return Standard_False;
}
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(theF, aLoc);
if (aT.IsNull())
{
theP = Handle(Poly_PolygonOnTriangulation) ();
return Standard_False;
}
theP = BRep_Tool::PolygonOnTriangulation(theE, aT, aLoc);
if (theP.IsNull())
{
return Standard_False;
}
theP = theP->Copy();
theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor()));
// transform the parametrization
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theF, aLoc);
Standard_Real aFirst, aLast;
Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theE, theF, aFirst, aLast);
if (!aSurf.IsNull() && !aC2d.IsNull() && Abs(Abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec())
{
gp_GTrsf2d aGTrsf = aSurf->ParametricTransformation(myTrsf);
if (aGTrsf.Form() != gp_Identity)
{
Handle(Geom2d_Curve) aNewC2d = GeomLib::GTransform(aC2d, aGTrsf);
for (Standard_Integer anInd = 1; anInd <= theP->NbNodes(); ++anInd)
{
Standard_Real aParam = theP->Parameter(anInd);
gp_Pnt2d aP2d = aC2d->Value(aParam);
aGTrsf.Transforms(aP2d.ChangeCoord());
GeomLib_Tool::Parameter(aNewC2d, aP2d, theP->Deflection(), aParam);
theP->SetParameter(anInd, aParam);
}
}
}
return Standard_True;
}
//=======================================================================
//function : NewCurve
@@ -307,10 +101,6 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve
{
Standard_Real f,l;
C = BRep_Tool::Curve(E,L,f,l);
if (C.IsNull())
{
return Standard_False;
}
Tol = BRep_Tool::Tolerance(E);
Tol *= Abs(myTrsf.ScaleFactor());
@@ -363,12 +153,6 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d
Standard_Real scale = myTrsf.ScaleFactor();
Tol *= Abs(scale);
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,loc);
if (S.IsNull())
{
// processing the case when the surface (geometry) is deleted
return Standard_False;
}
GeomAdaptor_Surface GAsurf(S);
if (GAsurf.GetType() == GeomAbs_Plane)
return Standard_False;

View File

@@ -50,9 +50,6 @@ public:
//! Provides access to the gp_Trsf associated with this
//! modification. The transformation can be changed.
Standard_EXPORT gp_Trsf& Trsf();
//! Sets a flag to indicate the need to copy mesh.
Standard_EXPORT Standard_Boolean& IsCopyMesh();
//! Returns true if the face F has been modified.
//! If the face has been modified:
@@ -67,21 +64,6 @@ public:
//! associated with this modification is negative.
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace) Standard_OVERRIDE;
//! Returns true if the face has been modified according to changed triangulation.
//! If the face has been modified:
//! - T is a new triangulation on the face
Standard_EXPORT Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon.
//! If the edge has been modified:
//! - P is a new polygon
Standard_EXPORT Standard_Boolean NewPolygon(const TopoDS_Edge& E, Handle(Poly_Polygon3D)& P) Standard_OVERRIDE;
//! Returns true if the edge has been modified according to changed polygon on triangulation.
//! If the edge has been modified:
//! - P is a new polygon on triangulation
Standard_EXPORT Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F, Handle(Poly_PolygonOnTriangulation)& P) Standard_OVERRIDE;
//! Returns true if the edge E has been modified.
//! If the edge has been modified:
//! - C is the new geometric support of the edge,
@@ -138,7 +120,6 @@ private:
gp_Trsf myTrsf;
Standard_Boolean myCopyMesh;
};

View File

@@ -1,7 +1,5 @@
BRepTools.cxx
BRepTools.hxx
BRepTools_CopyModification.cxx
BRepTools_CopyModification.hxx
BRepTools_DataMapIteratorOfMapOfVertexPnt2d.hxx
BRepTools_Debug.cxx
BRepTools_GTrsfModification.cxx

View File

@@ -229,12 +229,11 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
if (aFileVer >= TDocStd_FormatVersion_VERSION_3) {
BinLDrivers_DocumentSection aSection;
do {
if (!BinLDrivers_DocumentSection::ReadTOC (aSection, theIStream, aFileVer))
break;
BinLDrivers_DocumentSection::ReadTOC (aSection, theIStream, aFileVer);
mySections.Append(aSection);
} while (!aSection.Name().IsEqual (aQuickPart ? ENDSECTION_POS : SHAPESECTION_POS) && !theIStream.eof());
if (mySections.IsEmpty() || theIStream.eof()) {
if (theIStream.eof()) {
// There is no shape section in the file.
myMsgDriver->Send (aMethStr + "error: shape section is not found", Message_Fail);
myReaderStatus = PCDM_RS_ReaderException;

View File

@@ -214,17 +214,14 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream,
//purpose :
//=======================================================================
Standard_Boolean BinLDrivers_DocumentSection::ReadTOC (
BinLDrivers_DocumentSection& theSection,
void BinLDrivers_DocumentSection::ReadTOC
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& theStream,
const TDocStd_FormatVersion theDocFormatVersion)
{
static const int THE_BUF_SIZE = 512;
char aBuf[THE_BUF_SIZE];
char aBuf[512];
Standard_Integer aNameBufferSize;
theStream.read ((char *)&aNameBufferSize, sizeof(Standard_Integer));
if (theStream.eof() || aNameBufferSize > THE_BUF_SIZE)
return Standard_False;
#ifdef DO_INVERSE
aNameBufferSize = InverseSize(aNameBufferSize);
#endif
@@ -263,5 +260,4 @@ Standard_Boolean BinLDrivers_DocumentSection::ReadTOC (
theSection.myValue[1] = aValue[1];
theSection.myIsPostRead = (aValue[2] != 0);
}
return Standard_True;
}

View File

@@ -73,10 +73,9 @@ public:
const TDocStd_FormatVersion theDocFormatVersion);
//! Fill a DocumentSection instance from the data that are read
//! from TOC. Returns false in case of the stream reading problem.
Standard_EXPORT static Standard_Boolean ReadTOC (BinLDrivers_DocumentSection& theSection,
Standard_IStream& theIS,
const TDocStd_FormatVersion theDocFormatVersion);
//! from TOC.
Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS,
const TDocStd_FormatVersion theDocFormatVersion);

View File

@@ -54,7 +54,6 @@ static Standard_Byte faceCullToChar (Graphic3d_TypeOfBackfacingModel theMode)
{
case Graphic3d_TypeOfBackfacingModel_Auto: return '0';
case Graphic3d_TypeOfBackfacingModel_BackCulled: return 'B';
case Graphic3d_TypeOfBackfacingModel_FrontCulled: return 'F';
case Graphic3d_TypeOfBackfacingModel_DoubleSided: return '1';
}
return '0';
@@ -67,7 +66,6 @@ static Graphic3d_TypeOfBackfacingModel faceCullFromChar (Standard_Byte theMode)
{
case '0': return Graphic3d_TypeOfBackfacingModel_Auto;
case 'B': return Graphic3d_TypeOfBackfacingModel_BackCulled;
case 'F': return Graphic3d_TypeOfBackfacingModel_FrontCulled;
case '1': return Graphic3d_TypeOfBackfacingModel_DoubleSided;
}
return Graphic3d_TypeOfBackfacingModel_Auto;

View File

@@ -28,7 +28,7 @@ const Standard_CString BinTools_ShapeSetBase::THE_ASCII_VERSIONS[BinTools_Format
//function : operator << (gp_Pnt)
//purpose :
//=======================================================================
Standard_OStream& operator << (Standard_OStream& OS, const gp_Pnt& P)
Standard_OStream& operator << (Standard_OStream& OS, const gp_Pnt P)
{
BinTools::PutReal (OS, P.X());
BinTools::PutReal (OS, P.Y());

View File

@@ -27,7 +27,7 @@ class TopoDS_Shape;
class gp_Pnt;
//! Writes to the stream a gp_Pnt data
Standard_OStream& operator << (Standard_OStream& OS, const gp_Pnt& P);
Standard_OStream& operator << (Standard_OStream& OS, const gp_Pnt P);
//! Computes a hash code for the given value of the uint64_t type, in range [1, theUpperBound]
inline Standard_Integer HashCode (const uint64_t theValue, const Standard_Integer theUpperBound)

View File

@@ -0,0 +1,403 @@
// Created on: 1993-03-08
// Created by: Didier PIFFAULT
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Bnd_Array1OfBox.hxx>
#include <Bnd_BoundSortBox2d.hxx>
#include <Bnd_Box2d.hxx>
#include <Standard_MultiplyDefined.hxx>
#include <Standard_NullValue.hxx>
#include <TColStd_Array1OfListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
//=======================================================================
//function : Bnd_BoundSortBox2d
//purpose :
//=======================================================================
Bnd_BoundSortBox2d::Bnd_BoundSortBox2d()
: discrX(0), discrY(0)
{}
//=======================================================================
//function : Initialize
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::Initialize(const Bnd_Box2d& CompleteBox,
const Handle(Bnd_HArray1OfBox2d)& SetOfBox)
{
myBox=CompleteBox;
myBndComponents=SetOfBox;
discrX=SetOfBox->Length();
discrY=discrX;
Standard_Real xmin, ymin, xmax, ymax;
Standard_Real middleX=0.;
Standard_Real middleY=0.;
const Bnd_Array1OfBox2d & taBox=myBndComponents->Array1();
Standard_Integer labox;
for (labox=taBox.Lower(); labox<=taBox.Upper(); labox++) {
if (!taBox(labox).IsVoid()) {
taBox.Value(labox).Get(xmin, ymin, xmax, ymax);
middleX+=xmax-xmin;
middleY+=ymax-ymin;
}
}
middleX=middleX/taBox.Length();
middleY=middleY/taBox.Length();
Standard_Real Xmax, Ymax;
CompleteBox.Get(Xmin, Ymin, Xmax, Ymax);
deltaX=(Xmax-Xmin)/(Standard_Real)discrX;
deltaY=(Ymax-Ymin)/(Standard_Real)discrY;
if (middleX < Epsilon(100.)) {
discrX=1;
deltaX=Xmax-Xmin;
}
else if (middleX > deltaX) {
discrX=(Standard_Integer)((Xmax-Xmin)/middleX);
deltaX=middleX;
discrX++;
}
if (middleY < Epsilon(100.)) {
discrY=1;
deltaY=Ymax-Ymin;
}
else if (middleY > deltaY) {
discrY=(Standard_Integer)((Ymax-Ymin)/middleY + 0.1);
deltaY=middleY;
discrY++;
}
SortBoxes();
}
//=======================================================================
//function : Initialize
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::Initialize(const Handle(Bnd_HArray1OfBox2d)& SetOfBox)
{
myBndComponents=SetOfBox;
discrX=SetOfBox->Length();
discrY=discrX;
Standard_Real xmin, ymin, xmax, ymax;
Standard_Real middleX=0.;
Standard_Real middleY=0.;
const Bnd_Array1OfBox2d & taBox=myBndComponents->Array1();
Standard_Integer labox;
for (labox=taBox.Lower(); labox<=taBox.Upper(); labox++) {
if (!taBox(labox).IsVoid()) {
myBox.Add(taBox(labox));
taBox.Value(labox).Get(xmin, ymin, xmax, ymax);
middleX+=xmax-xmin;
middleY+=ymax-ymin;
}
}
middleX=middleX/taBox.Length();
middleY=middleY/taBox.Length();
Standard_Real Xmax, Ymax;
myBox.Get(Xmin, Ymin, Xmax, Ymax);
deltaX=(Xmax-Xmin)/(Standard_Real)discrX;
deltaY=(Ymax-Ymin)/(Standard_Real)discrY;
if (middleX < Epsilon(100.)) {
discrX=1;
deltaX=Xmax-Xmin;
}
else if (middleX > deltaX) {
discrX=(Standard_Integer)((Xmax-Xmin)/middleX);
deltaX=middleX;
discrX++;
}
if (middleY < Epsilon(100.)) {
discrY=1;
deltaY=Ymax-Ymin;
}
else if (middleY > deltaY) {
discrY=(Standard_Integer)((Ymax-Ymin)/middleY + 0.1);
deltaY=middleY;
discrY++;
}
SortBoxes();
}
//=======================================================================
//function : SortBoxes
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::SortBoxes()
{
Standard_NullValue_Raise_if (discrX+discrY <=0, "BoundSortBox2d nul!");
Standard_Integer labox, lacase, firstcase, lastcase;
Standard_Real xmin, ymin, xmax, ymax;
const Bnd_Array1OfBox2d & taBox=myBndComponents->Array1();
axisX=new TColStd_HArray1OfListOfInteger(1, discrX);
TColStd_Array1OfListOfInteger & tabListX=axisX->ChangeArray1();
axisY=new TColStd_HArray1OfListOfInteger(1, discrY);
TColStd_Array1OfListOfInteger & tabListY=axisY->ChangeArray1();
for (labox=taBox.Lower(); labox<=taBox.Upper(); labox++) {
if (!taBox(labox).IsVoid()) {
taBox(labox).Get(xmin, ymin, xmax, ymax);
if (discrX>1) {
firstcase=(Standard_Integer ) Max(1.0, (xmin-Xmin)/deltaX);
lastcase=(Standard_Integer ) Min((Standard_Real)discrX, ((xmax-Xmin)/deltaX)+1);
for (lacase=firstcase; lacase<=lastcase; lacase++) {
tabListX(lacase).Append(labox);
}
}
if (discrY >1) {
firstcase=(Standard_Integer ) Max(1.0, (ymin-Ymin)/deltaY);
lastcase=(Standard_Integer ) Min((Standard_Real)discrY, ((ymax-Ymin)/deltaY)+1);
for (lacase=firstcase; lacase<=lastcase; lacase++) {
tabListY(lacase).Append(labox);
}
}
}
}
}
//=======================================================================
//function : Initialize
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::Initialize(const Bnd_Box2d& CompleteBox,
const Standard_Integer nbComponents)
{
Standard_NullValue_Raise_if (nbComponents <=0, "BoundSortBox nul!");
myBox=CompleteBox;
myBndComponents=new Bnd_HArray1OfBox2d(1, nbComponents);
Bnd_Box2d emptyBox;
myBndComponents->Init( emptyBox );
discrX=nbComponents;
discrY=nbComponents;
Standard_Real Xmax, Ymax;
CompleteBox.Get(Xmin, Ymin, Xmax, Ymax);
deltaX=(Xmax-Xmin)/(Standard_Real)discrX;
deltaY=(Ymax-Ymin)/(Standard_Real)discrY;
if (deltaX < Epsilon(100.)) {
discrX=1;
deltaX=Xmax-Xmin;
}
else axisX=new TColStd_HArray1OfListOfInteger(1, discrX);
if (deltaY < Epsilon(100.)) {
discrY=1;
deltaY=Ymax-Ymin;
}
else axisY=new TColStd_HArray1OfListOfInteger(1, discrY);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::Add(const Bnd_Box2d& theBox,
const Standard_Integer boxIndex)
{
Standard_MultiplyDefined_Raise_if
(!(myBndComponents->Value(boxIndex).IsVoid()),
" This box is already defined !");
if (!theBox.IsVoid()) {
Bnd_Array1OfBox2d & taBox=myBndComponents->ChangeArray1();
Standard_Integer theGap, firstGap , lastGap;
Standard_Real xmin, ymin, xmax, ymax;
theBox.Get(xmin, ymin, xmax, ymax);
if (taBox.Lower()<=boxIndex && boxIndex<=taBox.Upper())
taBox(boxIndex).Update(xmin, ymin, xmax, ymax);
TColStd_Array1OfListOfInteger & tabListX=axisX->ChangeArray1();
if (discrX>1) {
firstGap=(Standard_Integer ) Max(1.0, ((xmin-Xmin)/deltaX)+1);
lastGap=(Standard_Integer ) Min((Standard_Real)discrX, ((xmax-Xmin)/deltaX)+1);
for (theGap=firstGap; theGap<=lastGap; theGap++) {
tabListX(theGap).Append(boxIndex);
}
}
TColStd_Array1OfListOfInteger & tabListY=axisY->ChangeArray1();
if (discrY >1) {
firstGap=(Standard_Integer ) Max(1.0, ((ymin-Ymin)/deltaY)+1);
lastGap=(Standard_Integer ) Min((Standard_Real)discrY, ((ymax-Ymin)/deltaY)+1);
for (theGap=firstGap; theGap<=lastGap; theGap++) {
tabListY(theGap).Append(boxIndex);
}
}
}
}
//=======================================================================
//function : Compare
//purpose :
//=======================================================================
const TColStd_ListOfInteger& Bnd_BoundSortBox2d::Compare
(const Bnd_Box2d& theBox)
{
Standard_NullValue_Raise_if (discrX+discrY <=0,
"Compare sur 1 BoundSortBox2d nul!");
lastResult.Clear();
if (theBox.IsVoid()) return lastResult;
if (theBox.IsOut(myBox)) return lastResult;
Standard_Integer lacase, firstcase, lastcase;
Standard_Real xmin, ymin, xmax, ymax;
theBox.Get(xmin, ymin, xmax, ymax);
const Bnd_Array1OfBox2d & taBox=myBndComponents->Array1();
Crible.Clear();
theFound=2;
Standard_Integer cardY=0;
if (discrY>1 && (!theBox.IsOpenYmin() || !theBox.IsOpenYmax())) {
const TColStd_Array1OfListOfInteger & tabList=axisY->Array1();
firstcase=(Standard_Integer ) Max(1.0, (ymin-Ymin)/deltaY);
lastcase=(Standard_Integer ) Min((Standard_Real)discrY, ((ymax-Ymin)/deltaY)+1);
for (lacase=firstcase; lacase<=lastcase; lacase++) {
TColStd_ListIteratorOfListOfInteger theList(tabList(lacase));
for (; theList.More(); theList.Next()) {
cardY++;
Crible.Bind(theList.Value(), 2);
}
}
if (cardY==0) return lastResult;
}
else {
if (ymin > Ymin+deltaY || ymax < Ymin)
return lastResult;
theFound-=2;
}
if (discrX>1 && (!theBox.IsOpenXmin() || !theBox.IsOpenXmax())) {
const TColStd_Array1OfListOfInteger & tabList=axisX->Array1();
firstcase=(Standard_Integer ) Max(1.0, (xmin-Xmin)/deltaX);
lastcase=(Standard_Integer ) Min((Standard_Real)discrX, ((xmax-Xmin)/deltaX)+1);
for (lacase=firstcase; lacase<=lastcase; lacase++) {
TColStd_ListIteratorOfListOfInteger theList(tabList(lacase));
for (; theList.More(); theList.Next()) {
if (Crible.IsBound(theList.Value())) {
if (Crible(theList.Value())==theFound) {
if (!taBox.Value(theList.Value()).IsOut(theBox)){
lastResult.Append(theList.Value());
Crible(theList.Value())=0;
}
}
}
}
}
return lastResult;
}
else {
if (xmin > Xmin+deltaX || xmax < Xmin) return lastResult;
else if (discrY==1)
{
lacase=1;
for(Standard_Integer i=taBox.Lower();i<=taBox.Upper();i++)
{
lastResult.Append(i);
}
}
else{
TColStd_DataMapIteratorOfDataMapOfIntegerInteger itDM(Crible);
for (; itDM.More(); itDM.Next()) {
if (itDM.Value()==theFound) {
if (taBox.Lower()<=itDM.Key() && itDM.Key()<=taBox.Upper()) {
if (!taBox(itDM.Key()).IsOut(theBox))
lastResult.Append(itDM.Key());
}
else {
lastResult.Append(itDM.Key());
}
}
}
}
}
return lastResult;
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
void Bnd_BoundSortBox2d::Dump() const
{
Standard_Integer lacase;
std::cout << "axis X : " << discrX << " intervalles de " << deltaX << std::endl;
if (discrX>1) {
const TColStd_Array1OfListOfInteger & tabList=axisX->Array1();
for (lacase=1; lacase<=discrX; lacase++) {
std::cout << " X " << lacase << " : " ;
TColStd_ListIteratorOfListOfInteger theList(tabList(lacase));
for (; theList.More(); theList.Next()) {
std::cout << theList.Value() << " ";
}
std::cout << "\n";
}
}
std::cout << "axis Y : " << discrY << " intervalles de " << deltaY << std::endl;
if (discrY>1) {
const TColStd_Array1OfListOfInteger & tabList=axisY->Array1();
for (lacase=1; lacase<=discrY; lacase++) {
std::cout << " Y " << lacase << " : " ;
TColStd_ListIteratorOfListOfInteger theList(tabList(lacase));
for (; theList.More(); theList.Next()) {
std::cout << theList.Value() << " ";
}
std::cout << "\n";
}
}
}

View File

@@ -0,0 +1,129 @@
// Created on: 1993-03-05
// Created by: Didier PIFFAULT
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Bnd_BoundSortBox2d_HeaderFile
#define _Bnd_BoundSortBox2d_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Bnd_HArray1OfBox2d.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HArray1OfListOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
//! A tool to compare a 2D bounding box with a set of 2D
//! bounding boxes. It sorts the set of bounding boxes to give
//! the list of boxes which intersect the element being compared.
//! The boxes being sorted generally bound a set of shapes,
//! while the box being compared bounds a shape to be
//! compared. The resulting list of intersecting boxes therefore
//! gives the list of items which potentially intersect the shape to be compared.
class Bnd_BoundSortBox2d
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty comparison algorithm for 2D bounding boxes.
//! The bounding boxes are then defined using the Initialize function.
Standard_EXPORT Bnd_BoundSortBox2d();
//! Initializes this comparison algorithm with
//! - the set of 2D bounding boxes SetOfBox
Standard_EXPORT void Initialize (const Bnd_Box2d& CompleteBox, const Handle(Bnd_HArray1OfBox2d)& SetOfBox);
//! Initializes this comparison algorithm with
//! - the set of 2D bounding boxes SetOfBox, where
//! CompleteBox is given as the global bounding box of SetOfBox.
Standard_EXPORT void Initialize (const Handle(Bnd_HArray1OfBox2d)& SetOfBox);
//! Initializes this comparison algorithm, giving it only
//! - the maximum number nbComponents, and
//! - the global bounding box CompleteBox,
//! of the 2D bounding boxes to be managed. Use the Add
//! function to define the array of bounding boxes to be sorted by this algorithm.
Standard_EXPORT void Initialize (const Bnd_Box2d& CompleteBox, const Standard_Integer nbComponents);
//! Adds the 2D bounding box theBox at position boxIndex in
//! the array of boxes to be sorted by this comparison algorithm.
//! This function is used only in conjunction with the third
//! syntax described in the synopsis of Initialize.
//! Exceptions
//! - Standard_OutOfRange if boxIndex is not in the
//! range [ 1,nbComponents ] where
//! nbComponents is the maximum number of bounding
//! boxes declared for this comparison algorithm at
//! initialization.
//! - Standard_MultiplyDefined if a box still exists at
//! position boxIndex in the array of boxes to be sorted by
//! this comparison algorithm.
Standard_EXPORT void Add (const Bnd_Box2d& theBox, const Standard_Integer boxIndex);
//! Compares the 2D bounding box theBox with the set of
//! bounding boxes to be sorted by this comparison algorithm,
//! and returns the list of intersecting bounding boxes as a list
//! of indexes on the array of bounding boxes used by this algorithm.
Standard_EXPORT const TColStd_ListOfInteger& Compare (const Bnd_Box2d& theBox);
Standard_EXPORT void Dump() const;
protected:
private:
//! Prepares BoundSortBox2d and sorts the rectangles of
//! <SetOfBox> .
Standard_EXPORT void SortBoxes();
Bnd_Box2d myBox;
Handle(Bnd_HArray1OfBox2d) myBndComponents;
Standard_Real Xmin;
Standard_Real Ymin;
Standard_Real deltaX;
Standard_Real deltaY;
Standard_Integer discrX;
Standard_Integer discrY;
Handle(TColStd_HArray1OfListOfInteger) axisX;
Handle(TColStd_HArray1OfListOfInteger) axisY;
Standard_Integer theFound;
TColStd_DataMapOfIntegerInteger Crible;
TColStd_ListOfInteger lastResult;
};
#endif // _Bnd_BoundSortBox2d_HeaderFile

View File

@@ -46,7 +46,7 @@ Bnd_Box::Bnd_Box()
//function : Bnd_Box
//purpose :
//=======================================================================
Bnd_Box::Bnd_Box (const gp_Pnt& theMin, const gp_Pnt& theMax)
Bnd_Box::Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax)
: Gap (0.0)
{
SetVoid();

View File

@@ -71,7 +71,7 @@ public:
//! Creates a bounding box, it contains:
//! - minimum/maximum point of bounding box,
//! The constructed box is qualified Void. Its gap is null.
Standard_EXPORT Bnd_Box (const gp_Pnt& theMin, const gp_Pnt& theMax);
Standard_EXPORT Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax);
//! Sets this bounding box so that it covers the whole of 3D space.
//! It is infinitely long in all directions.

View File

@@ -419,7 +419,7 @@ OBBTool::
myPointBoxSet->SetSize(myPntsList.Length());
// Add the points into Set
for (Standard_Integer iP = theL.Lower(); iP <= theL.Upper(); ++iP)
for (Standard_Integer iP = 0; iP < theL.Length(); ++iP)
{
const gp_Pnt& aP = theL (iP);
Standard_Real aTol = theLT ? theLT->Value(iP) : Precision::Confusion();

View File

@@ -1,4 +1,7 @@
// Copyright (c) 2022 OPEN CASCADE SAS
// Created on: 1991-01-08
// Created by: Didier Piffault
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -11,13 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _GeomConvert_ConvType_HeaderFile
#define _GeomConvert_ConvType_HeaderFile
enum GeomConvert_ConvType
{
GeomConvert_Target,
GeomConvert_Simplest,
GeomConvert_MinGap
};
#ifndef Bnd_SeqOfBox_HeaderFile
#define Bnd_SeqOfBox_HeaderFile
#endif // _GeomConvert_ConvType_HeaderFile
#include <Bnd_Box.hxx>
#include <NCollection_Sequence.hxx>
//! This sequence used to store the bounding boxes of sub-Shapes.
typedef NCollection_Sequence<Bnd_Box> Bnd_SeqOfBox;
#endif

View File

@@ -15,6 +15,8 @@ Bnd_B3x.gxx
Bnd_B3x.lxx
Bnd_BoundSortBox.cxx
Bnd_BoundSortBox.hxx
Bnd_BoundSortBox2d.cxx
Bnd_BoundSortBox2d.hxx
Bnd_Box.cxx
Bnd_Box.hxx
Bnd_Box2d.cxx
@@ -26,6 +28,7 @@ Bnd_OBB.cxx
Bnd_OBB.hxx
Bnd_Range.cxx
Bnd_Range.hxx
Bnd_SeqOfBox.hxx
Bnd_Sphere.cxx
Bnd_Sphere.hxx
Bnd_Sphere.lxx

View File

@@ -217,7 +217,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
if(Bsaux->LastParameter() < U2 ) u2 = Bsaux->LastParameter();
// modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___
}
Standard_Real aSegmentTol = 2. * Precision::PConfusion();
Standard_Real aSegmentTol = Precision::PConfusion();
if (Abs(u2 - u1) < aSegmentTol)
aSegmentTol = Abs(u2 - u1) * 0.01;
Bsaux->Segment(u1, u2, aSegmentTol);

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