mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
623e17d27f |
@@ -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})
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
@@ -459,7 +454,6 @@ t TKRWMesh
|
||||
n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n RWPly
|
||||
n DFBrowser
|
||||
n DFBrowserPane
|
||||
n DFBrowserPaneXDE
|
||||
|
@@ -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")
|
||||
|
@@ -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)
|
||||
|
@@ -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).
|
||||
|
@@ -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)
|
||||
}
|
||||
|
@@ -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}
|
||||
|
@@ -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
|
||||
|
@@ -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%
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
651
dox/build/build_3rdparty/building_3rdparty.md
vendored
651
dox/build/build_3rdparty/building_3rdparty.md
vendored
@@ -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
|
||||
|
@@ -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:
|
||||
|
@@ -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.
|
||||
|
@@ -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()`.
|
||||
|
@@ -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
|
||||
|
@@ -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
@@ -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>
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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.
|
||||
|
@@ -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 + ")";
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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())
|
||||
{
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -1948,7 +1948,7 @@ int mcrcomm_(integer *kop,
|
||||
/* Local variables */
|
||||
intptr_t ideb;
|
||||
doublereal dtab[32000];
|
||||
intptr_t itab[160] = {0} /* was [4][40] */;
|
||||
intptr_t itab[160] /* was [4][40] */;
|
||||
intptr_t ipre;
|
||||
integer i__, j, k;
|
||||
|
||||
@@ -2522,7 +2522,7 @@ int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
|
||||
|
||||
/* Local variables */
|
||||
char cfmt[1];
|
||||
doublereal dfmt = 0.0; // unused
|
||||
doublereal dfmt;
|
||||
integer ifmt, i__, nufmt, ntotal;
|
||||
char subrou[7];
|
||||
|
||||
@@ -2667,7 +2667,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
integer i__1, i__2;
|
||||
|
||||
/* Local variables */
|
||||
doublereal dfmt = 0.0; // unused
|
||||
doublereal dfmt;
|
||||
integer ifmt, iver;
|
||||
char subr[7];
|
||||
integer ksys , ibyte, irest, ier;
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -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
|
||||
|
@@ -77,8 +77,7 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
|
||||
for(Standard_Integer i=1; i<=aNbPnts; i++)
|
||||
{
|
||||
const IntSurf_PntOn2S POn2S = theline->Point(i);
|
||||
Standard_Real U = 0.0;
|
||||
Standard_Real V = 0.0;
|
||||
Standard_Real U,V;
|
||||
(POn2S.*pfunc)(U,V);
|
||||
aUmin = Min(U, aUmin);
|
||||
aVmin = Min(V, aVmin);
|
||||
|
@@ -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; }
|
||||
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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:
|
||||
//
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
|
@@ -148,14 +148,15 @@ void BRepCheck_Edge::Minimum()
|
||||
BRepCheck::Add(lst,BRepCheck_InvalidRange);
|
||||
}
|
||||
else {
|
||||
if (myCref->IsCurve3D()) {
|
||||
IsCurve3D = myCref->IsCurve3D();
|
||||
if (IsCurve3D) {
|
||||
// eap 6 Jun 2002 occ332
|
||||
// better transform C3d instead of transforming Surf upto C3d initial location,
|
||||
// on transformed BSpline surface 'same parameter' may seem wrong
|
||||
TopLoc_Location L = myShape.Location() * myCref->Location();
|
||||
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
|
||||
(myCref->Curve3D()->Transformed
|
||||
(/*myCref->Location()*/L.Transformation()));
|
||||
(myCref->Curve3D()->Transformed
|
||||
(/*myCref->Location()*/L.Transformation()));
|
||||
Standard_Boolean IsPeriodic = C3d->IsPeriodic();
|
||||
Standard_Real aPeriod = RealLast();
|
||||
if(IsPeriodic)
|
||||
@@ -186,9 +187,8 @@ void BRepCheck_Edge::Minimum()
|
||||
}
|
||||
else
|
||||
{
|
||||
GeomAdaptor_Curve GAC3d(C3d, C3d->TransformedParameter(First, L.Transformation()),
|
||||
C3d->TransformedParameter(Last, L.Transformation()));
|
||||
myHCurve = new GeomAdaptor_Curve(GAC3d);
|
||||
TopoDS_Shape aShape;
|
||||
myHCurve = GetEdgeCurve(aShape);
|
||||
}
|
||||
}
|
||||
else { // curve on surface
|
||||
@@ -226,11 +226,8 @@ void BRepCheck_Edge::Minimum()
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(GeomAdaptor_Surface) GAHSref = new GeomAdaptor_Surface(Sref);
|
||||
Handle(Geom2dAdaptor_Curve) GHPCref =
|
||||
new Geom2dAdaptor_Curve(PCref,First,Last);
|
||||
Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
|
||||
myHCurve = new Adaptor3d_CurveOnSurface(ACSref);
|
||||
TopoDS_Shape aShape;
|
||||
myHCurve = GetEdgeCurve(aShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,6 +298,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||
return;
|
||||
}
|
||||
// Modified by skv - Tue Apr 27 11:48:14 2004 End
|
||||
myHCurve = GetEdgeCurve(S);
|
||||
Standard_Real First = myHCurve->FirstParameter();
|
||||
Standard_Real Last = myHCurve->LastParameter();
|
||||
|
||||
@@ -372,7 +370,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||
Handle(Geom_Surface) Sb = cr->Surface();
|
||||
Sb = Handle(Geom_Surface)::DownCast
|
||||
// (Su->Transformed(L.Transformation()));
|
||||
(Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
|
||||
(Su->Transformed(/*L*/TFloc.Transformation()));
|
||||
Handle(Geom2d_Curve) PC = cr->PCurve();
|
||||
Handle(GeomAdaptor_Surface) GAHS = new GeomAdaptor_Surface(Sb);
|
||||
Handle(Geom2dAdaptor_Curve) GHPC = new Geom2dAdaptor_Curve(PC,f,l);
|
||||
@@ -440,7 +438,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||
// plan en position
|
||||
if (myGctrl) {
|
||||
P = Handle(Geom_Plane)::
|
||||
DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
|
||||
DownCast(P->Transformed(/*L*/TFloc.Transformation()));// eap occ332
|
||||
//on projette Cref sur ce plan
|
||||
Handle(GeomAdaptor_Surface) GAHS = new GeomAdaptor_Surface(P);
|
||||
|
||||
@@ -548,6 +546,64 @@ Standard_Boolean BRepCheck_Edge::GeometricControls() const
|
||||
return myGctrl;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetEdgeCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_Curve) BRepCheck_Edge::GetEdgeCurve(const TopoDS_Shape& theShape)
|
||||
{
|
||||
Handle(Adaptor3d_Curve) aLocalCurve;
|
||||
Handle(BRep_GCurve) GCref(Handle(BRep_GCurve)::DownCast(myCref));
|
||||
Standard_Real First, Last;
|
||||
GCref->Range(First, Last);
|
||||
if (IsCurve3D)
|
||||
{
|
||||
|
||||
TopLoc_Location L = myShape.Location() * myCref->Location();
|
||||
Handle(Geom_Curve) C3d;
|
||||
if (!theShape.IsNull())
|
||||
{
|
||||
C3d = Handle(Geom_Curve)::DownCast
|
||||
(myCref->Curve3D()->Transformed
|
||||
(/*myCref->Location()*/L.Predivided(theShape.Location()).Transformation()));
|
||||
}
|
||||
else
|
||||
{
|
||||
C3d = Handle(Geom_Curve)::DownCast
|
||||
(myCref->Curve3D()->Transformed
|
||||
(/*myCref->Location()*/L.Transformation()));
|
||||
}
|
||||
GeomAdaptor_Curve GAC3d(C3d, C3d->TransformedParameter(First, L.Transformation()),
|
||||
C3d->TransformedParameter(Last, L.Transformation()));
|
||||
aLocalCurve = new GeomAdaptor_Curve(GAC3d);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Geom_Surface) Sref = myCref->Surface();
|
||||
if (!theShape.IsNull())
|
||||
{
|
||||
Sref = Handle(Geom_Surface)::DownCast
|
||||
(Sref->Transformed(myCref->Location().Predivided(theShape.Location()).Transformation()));
|
||||
}
|
||||
else
|
||||
{
|
||||
Sref = Handle(Geom_Surface)::DownCast
|
||||
(Sref->Transformed(myCref->Location().Transformation()));
|
||||
}
|
||||
const Handle(Geom2d_Curve)& PCref = myCref->PCurve();
|
||||
Handle(GeomAdaptor_Surface) GAHSref = new GeomAdaptor_Surface(Sref);
|
||||
Handle(Geom2dAdaptor_Curve) GHPCref =
|
||||
new Geom2dAdaptor_Curve(PCref, First, Last);
|
||||
Adaptor3d_CurveOnSurface ACSref(GHPCref, GAHSref);
|
||||
aLocalCurve = new Adaptor3d_CurveOnSurface(ACSref);
|
||||
}
|
||||
|
||||
return aLocalCurve;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetStatus
|
||||
//purpose :
|
||||
|
@@ -45,6 +45,11 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Boolean GeometricControls() const;
|
||||
|
||||
//! Creates a 3d curve or surface on a curve by subtracting the location of the face
|
||||
//! @param[in] theShape input shape to get the location from it
|
||||
//! @return a 3d curve or curve on a surface
|
||||
Standard_EXPORT Handle(Adaptor3d_Curve) GetEdgeCurve(const TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT void GeometricControls (const Standard_Boolean B);
|
||||
|
||||
Standard_EXPORT Standard_Real Tolerance();
|
||||
@@ -81,6 +86,7 @@ private:
|
||||
Handle(Adaptor3d_Curve) myHCurve;
|
||||
Standard_Boolean myGctrl;
|
||||
Standard_Boolean myIsExactMethod;
|
||||
Standard_Boolean IsCurve3D;
|
||||
};
|
||||
|
||||
#endif // _BRepCheck_Edge_HeaderFile
|
||||
|
@@ -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>
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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&)
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -1,307 +0,0 @@
|
||||
// Copyright (c) 2021 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 <BRepLib_PointCloudShape.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepLib_ToolTriangulatedShape.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <random>
|
||||
|
||||
// =======================================================================
|
||||
// function : BRepLib_PointCloudShape
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
BRepLib_PointCloudShape::BRepLib_PointCloudShape (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTol)
|
||||
: myShape (theShape),
|
||||
myDist (0.0),
|
||||
myTol (theTol),
|
||||
myNbPoints (0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ~BRepLib_PointCloudShape
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
BRepLib_PointCloudShape::~BRepLib_PointCloudShape()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : NbPointsByDensity
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity (const Standard_Real theDensity)
|
||||
{
|
||||
clear();
|
||||
Standard_Real aDensity = (theDensity < Precision::Confusion() ? computeDensity() : theDensity);
|
||||
if (aDensity < Precision::Confusion())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Integer aNbPoints = 0;
|
||||
for (TopExp_Explorer aExpF(myShape, TopAbs_FACE); aExpF.More(); aExpF.Next())
|
||||
{
|
||||
Standard_Real anArea = faceArea(aExpF.Current());
|
||||
|
||||
Standard_Integer aNbPnts = Max ((Standard_Integer)std::ceil(anArea / theDensity), 1);
|
||||
myFacePoints.Bind(aExpF.Current(), aNbPnts);
|
||||
aNbPoints+= aNbPnts;
|
||||
}
|
||||
return aNbPoints;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GeneratePointsByDensity
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByDensity (const Standard_Real theDensity)
|
||||
{
|
||||
if (myFacePoints.IsEmpty())
|
||||
{
|
||||
if (NbPointsByDensity (theDensity) == 0)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer aNbAdded = 0;
|
||||
for (TopExp_Explorer aExpF (myShape, TopAbs_FACE); aExpF.More(); aExpF.Next())
|
||||
{
|
||||
if (addDensityPoints (aExpF.Current()))
|
||||
{
|
||||
aNbAdded++;
|
||||
}
|
||||
}
|
||||
return (aNbAdded > 0);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GeneratePointsByTriangulation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByTriangulation()
|
||||
{
|
||||
clear();
|
||||
|
||||
Standard_Integer aNbAdded = 0;
|
||||
for (TopExp_Explorer aExpF (myShape, TopAbs_FACE); aExpF.More(); aExpF.Next())
|
||||
{
|
||||
if (addTriangulationPoints (aExpF.Current()))
|
||||
{
|
||||
aNbAdded++;
|
||||
}
|
||||
}
|
||||
return (aNbAdded > 0);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : faceArea
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Real BRepLib_PointCloudShape::faceArea (const TopoDS_Shape& theShape)
|
||||
{
|
||||
Standard_Real anArea = 0.0;
|
||||
if (myFaceArea.Find (theShape, anArea))
|
||||
{
|
||||
return anArea;
|
||||
}
|
||||
|
||||
GProp_GProps aFaceProps;
|
||||
BRepGProp::SurfaceProperties (theShape, aFaceProps);
|
||||
anArea = aFaceProps.Mass();
|
||||
myFaceArea.Bind (theShape, anArea);
|
||||
return anArea;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : computeDensity
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Real BRepLib_PointCloudShape::computeDensity()
|
||||
{
|
||||
// at first step find the face with smallest area
|
||||
Standard_Real anAreaMin = Precision::Infinite();
|
||||
for (TopExp_Explorer aExpF (myShape, TopAbs_FACE); aExpF.More(); aExpF.Next())
|
||||
{
|
||||
Standard_Real anArea = faceArea (aExpF.Current());
|
||||
if (anArea < myTol * myTol)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (anArea < anAreaMin)
|
||||
{
|
||||
anAreaMin = anArea;
|
||||
}
|
||||
}
|
||||
return anAreaMin * 0.1;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : NbPointsByTriangulation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Integer BRepLib_PointCloudShape::NbPointsByTriangulation() const
|
||||
{
|
||||
// at first step find the face with smallest area
|
||||
Standard_Integer aNbPoints = 0;
|
||||
for (TopExp_Explorer aExpF (myShape, TopAbs_FACE); aExpF.More(); aExpF.Next())
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (TopoDS::Face (aExpF.Current()), aLoc);
|
||||
if (aTriangulation.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
aNbPoints += aTriangulation->NbNodes();
|
||||
}
|
||||
return aNbPoints;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : addDensityPoints
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean BRepLib_PointCloudShape::addDensityPoints (const TopoDS_Shape& theFace)
|
||||
{
|
||||
//addition of the points with specified density on the face by random way
|
||||
Standard_Integer aNbPnts = (myFacePoints.IsBound (theFace) ? myFacePoints.Find (theFace) : 0);
|
||||
if (aNbPnts == 0)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TopoDS_Face aFace = TopoDS::Face (theFace);
|
||||
Standard_Real anUMin = 0.0, anUMax = 0.0, aVMin = 0.0, aVMax = 0.0;
|
||||
BRepTools::UVBounds (aFace, anUMin, anUMax, aVMin, aVMax);
|
||||
BRepTopAdaptor_FClass2d aClassifier (aFace, Precision::Confusion());
|
||||
|
||||
TopLoc_Location aLoc = theFace.Location();
|
||||
const gp_Trsf& aTrsf = aLoc.Transformation();
|
||||
TopLoc_Location aLoc1;
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace, aLoc1);
|
||||
if (aSurf.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
std::mt19937 aRandomGenerator(0);
|
||||
std::uniform_real_distribution<> anUDistrib(anUMin, anUMax);
|
||||
std::uniform_real_distribution<> aVDistrib (aVMin, aVMax);
|
||||
for (Standard_Integer nbCurPnts = 1; nbCurPnts <= aNbPnts;)
|
||||
{
|
||||
const Standard_Real aU = anUDistrib(aRandomGenerator);
|
||||
const Standard_Real aV = aVDistrib (aRandomGenerator);
|
||||
gp_Pnt2d aUVNode (aU, aV);
|
||||
const TopAbs_State aState = aClassifier.Perform (aUVNode);
|
||||
if (aState == TopAbs_OUT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
nbCurPnts++;
|
||||
|
||||
gp_Pnt aP1;
|
||||
gp_Vec dU, dV;
|
||||
aSurf->D1 (aU, aV, aP1, dU, dV);
|
||||
|
||||
gp_Vec aNorm = dU ^ dV;
|
||||
if (aFace.Orientation() == TopAbs_REVERSED)
|
||||
{
|
||||
aNorm.Reverse();
|
||||
}
|
||||
const Standard_Real aNormMod = aNorm.Magnitude();
|
||||
if (aNormMod > gp::Resolution())
|
||||
{
|
||||
aNorm /= aNormMod;
|
||||
}
|
||||
if (myDist > Precision::Confusion())
|
||||
{
|
||||
std::uniform_real_distribution<> aDistanceDistrib (0.0, myDist);
|
||||
gp_XYZ aDeflPoint = aP1.XYZ() + aNorm.XYZ() * aDistanceDistrib (aRandomGenerator);
|
||||
aP1.SetXYZ (aDeflPoint);
|
||||
}
|
||||
aP1.Transform (aTrsf);
|
||||
if (aNormMod > gp::Resolution())
|
||||
{
|
||||
aNorm = gp_Dir (aNorm).Transformed (aTrsf);
|
||||
}
|
||||
addPoint (aP1, aNorm, aUVNode, aFace);
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : addTriangulationPoints
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean BRepLib_PointCloudShape::addTriangulationPoints (const TopoDS_Shape& theFace)
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
TopoDS_Face aFace = TopoDS::Face (theFace);
|
||||
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (aFace, aLoc);
|
||||
if (aTriangulation.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TopLoc_Location aLoc1;
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace, aLoc1);
|
||||
const gp_Trsf& aTrsf = aLoc.Transformation();
|
||||
|
||||
BRepLib_ToolTriangulatedShape::ComputeNormals (aFace, aTriangulation);
|
||||
Standard_Boolean aHasUVNode = aTriangulation->HasUVNodes();
|
||||
for (Standard_Integer aNodeIter = 1; aNodeIter <= aTriangulation->NbNodes(); ++aNodeIter)
|
||||
{
|
||||
gp_Pnt aP1 = aTriangulation->Node (aNodeIter);
|
||||
gp_Dir aNormal = aTriangulation->Normal(aNodeIter);
|
||||
if (!aLoc.IsIdentity())
|
||||
{
|
||||
aP1 .Transform (aTrsf);
|
||||
aNormal.Transform (aTrsf);
|
||||
}
|
||||
|
||||
const gp_Pnt2d anUVNode = aHasUVNode ? aTriangulation->UVNode (aNodeIter) : gp_Pnt2d();
|
||||
addPoint (aP1, aNormal, anUVNode, aFace);
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : clear
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void BRepLib_PointCloudShape::clear()
|
||||
{
|
||||
myFaceArea.Clear();
|
||||
myFacePoints.Clear();
|
||||
}
|
@@ -1,116 +0,0 @@
|
||||
// Copyright (c) 2021 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 _BRepLib_PointCloudShape_HeaderFile
|
||||
#define _BRepLib_PointCloudShape_HeaderFile
|
||||
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#include <TopTools_DataMapOfShapeReal.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//! This tool is intended to get points from shape with specified distance from shape along normal.
|
||||
//! Can be used to simulation of points obtained in result of laser scan of shape.
|
||||
//! There are 2 ways for generation points by shape:
|
||||
//! 1. Generation points with specified density
|
||||
//! 2. Generation points using triangulation Nodes
|
||||
//! Generation of points by density using the GeneratePointsByDensity() function is not thread safe.
|
||||
class BRepLib_PointCloudShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Constructor initialized by shape
|
||||
Standard_EXPORT BRepLib_PointCloudShape (const TopoDS_Shape& theShape = TopoDS_Shape(),
|
||||
const Standard_Real theTol = Precision::Confusion());
|
||||
|
||||
//! Virtual destructor
|
||||
Standard_EXPORT virtual ~BRepLib_PointCloudShape();
|
||||
|
||||
//! Return loaded shape.
|
||||
const TopoDS_Shape& Shape() const { return myShape; }
|
||||
|
||||
//! Set shape.
|
||||
void SetShape (const TopoDS_Shape& theShape) { myShape = theShape; }
|
||||
|
||||
//! Return tolerance.
|
||||
Standard_Real Tolerance() const { return myTol; }
|
||||
|
||||
//! Set tolerance.
|
||||
void SetTolerance (Standard_Real theTol) { myTol = theTol; }
|
||||
|
||||
//! Returns value of the distance to define deflection of points from shape along normal to shape; 0.0 by default.
|
||||
Standard_Real GetDistance() const { return myDist; }
|
||||
|
||||
//! Sets value of the distance to define deflection of points from shape along normal to shape.
|
||||
//! Negative values of theDist parameter are ignored.
|
||||
void SetDistance (const Standard_Real theDist) { myDist = theDist; }
|
||||
|
||||
//! Returns size of the point cloud for specified density.
|
||||
Standard_EXPORT Standard_Integer NbPointsByDensity (const Standard_Real theDensity = 0.0);
|
||||
|
||||
//! Returns size of the point cloud for using triangulation.
|
||||
Standard_EXPORT Standard_Integer NbPointsByTriangulation() const;
|
||||
|
||||
//! Computes points with specified density for initial shape.
|
||||
//! If parameter Density is equal to 0 then density will be computed automatically by criterion:
|
||||
//! - 10 points per minimal unreduced face area.
|
||||
//!
|
||||
//! Note: this function should not be called from concurrent threads without external lock.
|
||||
Standard_EXPORT Standard_Boolean GeneratePointsByDensity (const Standard_Real theDensity = 0.0);
|
||||
|
||||
//! Get points from triangulation existing in the shape.
|
||||
Standard_EXPORT Standard_Boolean GeneratePointsByTriangulation();
|
||||
|
||||
protected:
|
||||
|
||||
//! Compute area of the specified face.
|
||||
Standard_EXPORT Standard_Real faceArea (const TopoDS_Shape& theShape);
|
||||
|
||||
//! Computes default density points per face.
|
||||
Standard_EXPORT Standard_Real computeDensity();
|
||||
|
||||
//! Adds points to face in accordance with the specified density randomly in the specified range [0, Dist].
|
||||
Standard_EXPORT Standard_Boolean addDensityPoints (const TopoDS_Shape& theFace);
|
||||
|
||||
//! Adds points to face by nodes of the existing triangulation randomly in the specified range [0, Dist].
|
||||
Standard_EXPORT Standard_Boolean addTriangulationPoints (const TopoDS_Shape& theFace);
|
||||
|
||||
protected:
|
||||
|
||||
//! Method to clear maps.
|
||||
Standard_EXPORT virtual void clear();
|
||||
|
||||
//! Method to add point, normal to surface in this point and face for which point computed.
|
||||
//! @param[in] thePoint 3D point on the surface
|
||||
//! @param[in] theNorm surface normal at this point
|
||||
//! @param[in] theUV surface UV parameters
|
||||
//! @param[in] theFace surface (face) definition
|
||||
Standard_EXPORT virtual void addPoint (const gp_Pnt& thePoint,
|
||||
const gp_Vec& theNorm,
|
||||
const gp_Pnt2d& theUV,
|
||||
const TopoDS_Shape& theFace) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Real myDist;
|
||||
Standard_Real myTol;
|
||||
TopTools_DataMapOfShapeReal myFaceArea;
|
||||
TopTools_DataMapOfShapeInteger myFacePoints;
|
||||
Standard_Integer myNbPoints;
|
||||
|
||||
};
|
||||
|
||||
#endif // _BRepLib_PointCloudShape_HeaderFile
|
@@ -1,83 +0,0 @@
|
||||
// Copyright (c) 2021 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 <BRepLib_ToolTriangulatedShape.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <Poly.hxx>
|
||||
#include <Poly_Connect.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : ComputeNormals
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void BRepLib_ToolTriangulatedShape::ComputeNormals (const TopoDS_Face& theFace,
|
||||
const Handle(Poly_Triangulation)& theTris,
|
||||
Poly_Connect& thePolyConnect)
|
||||
{
|
||||
if (theTris.IsNull()
|
||||
|| theTris->HasNormals())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// take in face the surface location
|
||||
const TopoDS_Face aZeroFace = TopoDS::Face (theFace.Located (TopLoc_Location()));
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aZeroFace);
|
||||
if (!theTris->HasUVNodes() || aSurf.IsNull())
|
||||
{
|
||||
// compute normals by averaging triangulation normals sharing the same vertex
|
||||
Poly::ComputeNormals (theTris);
|
||||
return;
|
||||
}
|
||||
|
||||
const Standard_Real aTol = Precision::Confusion();
|
||||
Standard_Integer aTri[3];
|
||||
gp_Dir aNorm;
|
||||
theTris->AddNormals();
|
||||
for (Standard_Integer aNodeIter = 1; aNodeIter <= theTris->NbNodes(); ++aNodeIter)
|
||||
{
|
||||
// try to retrieve normal from real surface first, when UV coordinates are available
|
||||
if (GeomLib::NormEstim (aSurf, theTris->UVNode (aNodeIter), aTol, aNorm) > 1)
|
||||
{
|
||||
if (thePolyConnect.Triangulation() != theTris)
|
||||
{
|
||||
thePolyConnect.Load (theTris);
|
||||
}
|
||||
|
||||
// compute flat normals
|
||||
gp_XYZ eqPlan (0.0, 0.0, 0.0);
|
||||
for (thePolyConnect.Initialize (aNodeIter); thePolyConnect.More(); thePolyConnect.Next())
|
||||
{
|
||||
theTris->Triangle (thePolyConnect.Value()).Get (aTri[0], aTri[1], aTri[2]);
|
||||
const gp_XYZ v1 (theTris->Node (aTri[1]).Coord() - theTris->Node (aTri[0]).Coord());
|
||||
const gp_XYZ v2 (theTris->Node (aTri[2]).Coord() - theTris->Node (aTri[1]).Coord());
|
||||
const gp_XYZ vv = v1 ^ v2;
|
||||
const Standard_Real aMod = vv.Modulus();
|
||||
if (aMod >= aTol)
|
||||
{
|
||||
eqPlan += vv / aMod;
|
||||
}
|
||||
}
|
||||
const Standard_Real aModMax = eqPlan.Modulus();
|
||||
aNorm = (aModMax > aTol) ? gp_Dir (eqPlan) : gp::DZ();
|
||||
}
|
||||
|
||||
theTris->SetNormal (aNodeIter, aNorm);
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
// Copyright (c) 2021 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 _BrepLib_ToolTriangulatedShape_HeaderFile
|
||||
#define _BrepLib_ToolTriangulatedShape_HeaderFile
|
||||
|
||||
#include <Poly_Connect.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
|
||||
class TopoDS_Face;
|
||||
class Poly_Triangulation;
|
||||
|
||||
//! Provides methods for calculating normals to Poly_Triangulation of TopoDS_Face.
|
||||
class BRepLib_ToolTriangulatedShape
|
||||
{
|
||||
public:
|
||||
|
||||
//! Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface.
|
||||
//! Does nothing if triangulation already defines normals.
|
||||
//! @param[in] theFace the face
|
||||
//! @param[in] theTris the definition of a face triangulation
|
||||
static void ComputeNormals (const TopoDS_Face& theFace,
|
||||
const Handle(Poly_Triangulation)& theTris)
|
||||
{
|
||||
Poly_Connect aPolyConnect;
|
||||
ComputeNormals (theFace, theTris, aPolyConnect);
|
||||
}
|
||||
|
||||
//! Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface.
|
||||
//! Does nothing if triangulation already defines normals.
|
||||
//! @param[in] theFace the face
|
||||
//! @param[in] theTris the definition of a face triangulation
|
||||
//! @param[in,out] thePolyConnect optional, initialized tool for exploring triangulation
|
||||
Standard_EXPORT static void ComputeNormals (const TopoDS_Face& theFace,
|
||||
const Handle(Poly_Triangulation)& theTris,
|
||||
Poly_Connect& thePolyConnect);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -30,12 +30,8 @@ BRepLib_MakeVertex.hxx
|
||||
BRepLib_MakeWire.cxx
|
||||
BRepLib_MakeWire.hxx
|
||||
BRepLib_MakeWire_1.cxx
|
||||
BRepLib_PointCloudShape.hxx
|
||||
BRepLib_PointCloudShape.cxx
|
||||
BRepLib_ShapeModification.hxx
|
||||
BRepLib_ShellError.hxx
|
||||
BRepLib_ToolTriangulatedShape.hxx
|
||||
BRepLib_ToolTriangulatedShape.cxx
|
||||
BRepLib_ValidateEdge.cxx
|
||||
BRepLib_ValidateEdge.hxx
|
||||
BRepLib_WireError.hxx
|
||||
|
@@ -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));
|
||||
|
@@ -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);
|
||||
|
@@ -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",
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
@@ -51,7 +51,7 @@ Standard_Boolean BinMDF_TagSourceDriver::Paste
|
||||
BinObjMgt_RRelocationTable& ) const
|
||||
{
|
||||
Handle(TDF_TagSource) aTag = Handle(TDF_TagSource)::DownCast(theTarget);
|
||||
const Standard_Integer aValue = -1;
|
||||
Standard_Integer aValue;
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
if (ok)
|
||||
aTag->Set(aValue);
|
||||
|
@@ -73,7 +73,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste
|
||||
}
|
||||
if(aSize) {
|
||||
Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger ();
|
||||
const Standard_Integer aKey = -1;
|
||||
Standard_Integer aKey;
|
||||
for(Standard_Integer i = 0; i< aSize; i++) {
|
||||
Standard_Boolean ok = Source >> aKey;
|
||||
if (!ok) {
|
||||
|
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_IntegerDriver::Paste
|
||||
BinObjMgt_RRelocationTable& theRT) const
|
||||
{
|
||||
Handle(TDataStd_Integer) anAtt = Handle(TDataStd_Integer)::DownCast(theTarget);
|
||||
const Standard_Integer aValue = -1;
|
||||
Standard_Integer aValue;
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
if (ok)
|
||||
anAtt->Set(aValue);
|
||||
|
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_RealDriver::Paste
|
||||
BinObjMgt_RRelocationTable& theRelocTable) const
|
||||
{
|
||||
Handle(TDataStd_Real) anAtt= Handle(TDataStd_Real)::DownCast(theTarget);
|
||||
Standard_Real aValue = -1.0;
|
||||
Standard_Real aValue;
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
if (ok)
|
||||
anAtt->Set(aValue);
|
||||
|
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataXtd_GeometryDriver::Paste
|
||||
Handle(TDataXtd_Geometry) aT =
|
||||
Handle(TDataXtd_Geometry)::DownCast (theTarget);
|
||||
|
||||
const Standard_Integer aType = -1;
|
||||
Standard_Integer aType;
|
||||
Standard_Boolean ok = theSource >> aType;
|
||||
if (ok)
|
||||
aT->SetType ((TDataXtd_GeometryEnum) aType);
|
||||
|
@@ -55,7 +55,7 @@ Standard_Boolean BinMDataXtd_PositionDriver::Paste
|
||||
BinObjMgt_RRelocationTable& ) const
|
||||
{
|
||||
Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget);
|
||||
Standard_Real aValue = 0.0;
|
||||
Standard_Real aValue;
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
gp_Pnt aPosition(0., 0., 0.);
|
||||
|
@@ -56,7 +56,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
|
||||
Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theTarget);
|
||||
|
||||
// Display status
|
||||
const Standard_Integer aValue = -1;
|
||||
Standard_Integer aValue;
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
anAttribute->SetDisplayed (aValue != 0);
|
||||
@@ -92,7 +92,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
|
||||
anAttribute->UnsetMaterial();
|
||||
|
||||
// Transparency
|
||||
Standard_Real aRValue = -1.0;
|
||||
Standard_Real aRValue;
|
||||
ok = theSource >> aRValue;
|
||||
if ( !ok ) return ok;
|
||||
if ( aRValue != -1. )
|
||||
|
@@ -62,7 +62,7 @@ Standard_Boolean BinMFunction_FunctionDriver::Paste
|
||||
Standard_Boolean ok = theSource >> aGUID;
|
||||
if (ok) {
|
||||
anAtt->SetDriverGUID(aGUID);
|
||||
const Standard_Integer aValue = -1;
|
||||
Standard_Integer aValue;
|
||||
ok = theSource >> aValue;
|
||||
if(ok)
|
||||
anAtt->SetFailure(aValue);
|
||||
|
@@ -117,9 +117,8 @@ static int TranslateFrom (const BinObjMgt_Persistent& theSource,
|
||||
TopoDS_Shape& theResult,
|
||||
BinTools_ShapeSet* theShapeSet)
|
||||
{
|
||||
const Standard_Integer aShapeID = -1;
|
||||
const Standard_Integer aLocID = -1;
|
||||
const Standard_Character aCharOrient = '0';
|
||||
Standard_Integer aShapeID, aLocID;
|
||||
Standard_Character aCharOrient;
|
||||
Standard_Boolean Ok = theSource >> aShapeID; //TShapeID;
|
||||
if(!Ok) return 1;
|
||||
// Read TShape and Orientation
|
||||
@@ -177,11 +176,11 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
|
||||
theSource >> aNbShapes;
|
||||
TDF_Label aLabel = theTarget->Label ();
|
||||
TNaming_Builder aBuilder (aLabel);
|
||||
const Standard_Integer aVer = -1;
|
||||
Standard_Integer aVer;
|
||||
Standard_Boolean ok = theSource >> aVer;
|
||||
if(!ok) return Standard_False;
|
||||
aTAtt->SetVersion(aVer); //Version
|
||||
const Standard_Character aCharEvol = '0';
|
||||
Standard_Character aCharEvol;
|
||||
ok = theSource >> aCharEvol;
|
||||
if(!ok) return Standard_False;
|
||||
TNaming_Evolution anEvol = EvolutionToEnum (aCharEvol); //Evolution
|
||||
|
@@ -152,7 +152,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
|
||||
TNaming_Name& aName = anAtt->ChangeName();
|
||||
TCollection_ExtendedString aMsg;
|
||||
//1. NameType
|
||||
const Standard_Character aValue = '0';
|
||||
Standard_Character aValue;
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
Standard_Boolean aNewF = Standard_False;
|
||||
if (ok) {
|
||||
@@ -171,7 +171,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
|
||||
|
||||
//3. Args
|
||||
Standard_Integer aNbArgs=0;
|
||||
const Standard_Integer anIndx = -1;
|
||||
Standard_Integer anIndx;
|
||||
Handle(TNaming_NamedShape) aNS;
|
||||
ok = theSource >> aNbArgs;
|
||||
if (ok) {
|
||||
|
@@ -48,9 +48,7 @@ Standard_Boolean BinMXCAFDoc_CentroidDriver::Paste(const BinObjMgt_Persistent& t
|
||||
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
|
||||
{
|
||||
Handle(XCAFDoc_Centroid) anAtt = Handle(XCAFDoc_Centroid)::DownCast(theTarget);
|
||||
Standard_Real x = 0.0;
|
||||
Standard_Real y = 0.0;
|
||||
Standard_Real z = 0.0;
|
||||
Standard_Real x, y, z;
|
||||
Standard_Boolean isOk = theSource >> x >> y >> z;
|
||||
if(isOk) {
|
||||
gp_Pnt aPnt(x, y, z);
|
||||
|
@@ -48,10 +48,8 @@ Standard_Boolean BinMXCAFDoc_ColorDriver::Paste(const BinObjMgt_Persistent& theS
|
||||
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
|
||||
{
|
||||
Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theTarget);
|
||||
Standard_Real R = 0.0;
|
||||
Standard_Real G = 0.0;
|
||||
Standard_Real B = 0.0;
|
||||
Standard_ShortReal alpha = 1.0;
|
||||
Standard_Real R, G, B;
|
||||
Standard_ShortReal alpha;
|
||||
Standard_Boolean isOk = theSource >> R >> G >> B;
|
||||
if(isOk) {
|
||||
Standard_Boolean isRGBA = theSource >> alpha;
|
||||
|
@@ -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());
|
||||
|
@@ -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)
|
||||
|
403
src/Bnd/Bnd_BoundSortBox2d.cxx
Normal file
403
src/Bnd/Bnd_BoundSortBox2d.cxx
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
129
src/Bnd/Bnd_BoundSortBox2d.hxx
Normal file
129
src/Bnd/Bnd_BoundSortBox2d.hxx
Normal 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
|
@@ -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();
|
||||
|
@@ -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.
|
||||
|
@@ -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();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Created on : Thu Mar 24 18:30:12 2022
|
||||
// Created by: snn
|
||||
// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V2.0
|
||||
// Copyright (c) Open CASCADE 2022
|
||||
// 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.
|
||||
//
|
||||
@@ -14,13 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef Bnd_SeqOfBox_HeaderFile
|
||||
#define Bnd_SeqOfBox_HeaderFile
|
||||
|
||||
#ifndef StepVisual_Array1OfTessellatedEdgeOrVertex_HeaderFile
|
||||
#define StepVisual_Array1OfTessellatedEdgeOrVertex_HeaderFile
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
#include <StepVisual_TessellatedEdgeOrVertex.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
//! This sequence used to store the bounding boxes of sub-Shapes.
|
||||
typedef NCollection_Sequence<Bnd_Box> Bnd_SeqOfBox;
|
||||
|
||||
typedef NCollection_Array1<StepVisual_TessellatedEdgeOrVertex> StepVisual_Array1OfTessellatedEdgeOrVertex;
|
||||
|
||||
#endif
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -798,7 +798,7 @@ public:
|
||||
private:
|
||||
SurfMaxMinCoord & operator = (const SurfMaxMinCoord & theOther);
|
||||
|
||||
Standard_Boolean CheckInputData(const math_Vector& theParams)
|
||||
Standard_Boolean CheckInputData(const math_Vector theParams)
|
||||
{
|
||||
if (theParams(1) < myUMin ||
|
||||
theParams(1) > myUMax ||
|
||||
|
@@ -78,11 +78,19 @@ Standard_Boolean CDF_Store::SetFolder(const Standard_ExtString aFolder) {
|
||||
Standard_Boolean CDF_Store::SetFolder(const TCollection_ExtendedString& aFolder) {
|
||||
|
||||
TCollection_ExtendedString theFolder(aFolder);
|
||||
Standard_Integer aLen = theFolder.Length();
|
||||
Standard_Integer l = theFolder.Length();
|
||||
|
||||
// if the last character is the folder separator, remove it.
|
||||
if (aLen > 1 && (theFolder.Value(aLen) == '/' || theFolder.Value(aLen) == '\\'))
|
||||
theFolder.Trunc(aLen-1);
|
||||
// if the last character is the folder separator (which is always the first character)
|
||||
// it is removed.
|
||||
// This is correct for Unix systems but not for Windows! VMS and MAC? Thomas Haller, 23.11.01
|
||||
if(l > 1) {
|
||||
#ifndef _WIN32
|
||||
if(theFolder.Value(l) == theFolder.Value(1)) theFolder.Trunc(l-1);
|
||||
#else
|
||||
if (theFolder.Value(l) == '/' || theFolder.Value(l) == '\\')
|
||||
theFolder.Trunc(l-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(theMetaDataDriver->FindFolder(theFolder)) {
|
||||
myCurrentDocument->SetRequestedFolder(theFolder);
|
||||
|
@@ -198,7 +198,7 @@ public:
|
||||
Standard_Real LowerValue()
|
||||
{
|
||||
Standard_Integer a, aResultIndex = 0;
|
||||
Standard_Real aValue = 0.0;
|
||||
Standard_Real aValue;
|
||||
for(a = myV.Length(); a > 0; a--)
|
||||
{
|
||||
if (aResultIndex == 0 || Abs(aValue) > Abs(myV.Value(a)))
|
||||
|
@@ -134,12 +134,12 @@ ChFiDS_TypeOfConcavity ChFi3d::DefineConnectType(const TopoDS_Edge& E,
|
||||
//function : IsTangentFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape theOrder)
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape Order)
|
||||
{
|
||||
if (theOrder == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
if (Order == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
return Standard_True;
|
||||
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
@@ -147,46 +147,15 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||
|
||||
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_Edge anEdgeInFace1;
|
||||
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 Standard_False;
|
||||
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation (TopAbs_FORWARD);
|
||||
anEdgeInFace1.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (EE, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||
(EE, theFace2, aFirst, aLast);
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
@@ -217,19 +186,15 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, theOrder,
|
||||
aSurf1, aSurf2, Order,
|
||||
0.001, TolC0, 0.1, 0.1, 0.1);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
if (theOrder == GeomAbs_C2 &&
|
||||
aCont.StatusError() == LocalAnalysis_NullSecondDerivative)
|
||||
continue;
|
||||
|
||||
nbNotDone++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (theOrder == GeomAbs_G1)
|
||||
if (Order == GeomAbs_G1)
|
||||
{
|
||||
if (!aCont.IsG1())
|
||||
return Standard_False;
|
||||
|
@@ -732,13 +732,10 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS1() == fd2->IndexOfS1()) {
|
||||
jf1 = 1; jf2 = 1;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation. This would raise problems
|
||||
@@ -756,13 +753,10 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS2() == fd2->IndexOfS1()) {
|
||||
jf1 = 2; jf2 = 1;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation. This would raise problems
|
||||
@@ -792,13 +786,10 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS1() == fd2->IndexOfS2()) {
|
||||
jf1 = 1; jf2 = 2;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation.
|
||||
@@ -828,13 +819,10 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS2() == fd2->IndexOfS2()) {
|
||||
jf1 = 2; jf2 = 2;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user