1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

..

3 Commits

Author SHA1 Message Date
anv
7358493768 0033108: Coding - Updating geometric adaptors to work via Handles
Updated most interfaces to work with adaptors by handles
2022-09-06 14:09:47 +03:00
akaftasev
92915edda8 0030955: [Regression to 7.3.0] Modeling Algorithms - Incorrect result of fuse operation
Added test case.
2022-09-01 21:55:21 +03:00
mzernova
06aa200142 0032172: Visualization, TKOpenGl - implement simple shadow mapping for a spot light source
added test: opengl/data/shadows/spotlight
2022-08-31 10:27:30 +03:00
671 changed files with 5884 additions and 5914 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@@ -6,10 +6,6 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# set using C++ standard
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
# macro: include patched file if it exists
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
@@ -717,14 +713,14 @@ if (NOT DEFINED ANDROID AND CAN_USE_TBB)
add_definitions (-DHAVE_TBB)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB12")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_TBB")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB12")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
endif()

View File

@@ -32,13 +32,15 @@ if(__COTIRE_INCLUDED)
endif()
set(__COTIRE_INCLUDED TRUE)
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
# call cmake_minimum_required, but prevent modification of the CMake policy stack in include mode
# cmake_minimum_required also sets the policy version as a side effect, which we have to avoid
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(PUSH)
endif()
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(POP)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")

View File

@@ -12,7 +12,7 @@ endif()
# TBB
if (USE_TBB)
set (CSF_TBB "tbb12 tbbmalloc")
set (CSF_TBB "tbb tbbmalloc")
else()
set (CSF_TBB)
endif()

View File

@@ -116,9 +116,9 @@ if (MSVC)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]"))
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
endif()
if (BUILD_SHARED_LIBS)
@@ -130,26 +130,14 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
endif()
endif()
# Set desired C++ standard
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
set (CMAKE_CXX_STANDARD 11)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
set (CMAKE_CXX_STANDARD 14)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
set (CMAKE_CXX_STANDARD 17)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
set (CMAKE_CXX_STANDARD 20)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
set (CMAKE_CXX_STANDARD 23)
else ()
message (FATAL_ERROR, "misprint in c++ standard name")
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
if (APPLE)
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
elseif(NOT WIN32)
# CLang for Windows (at least CLang 8.0 distributed with VS 2019)
# does not support option "-std=c++0x"
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -160,10 +148,14 @@ elseif(MINGW)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
# Require C++11
set (CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
# Require C++11
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")

View File

@@ -80,9 +80,9 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (COMPILER icc)
else()
set (COMPILER ${CMAKE_GENERATOR})
@@ -589,7 +589,9 @@ macro (OCCT_UPDATE_TARGET_FILE)
endif()
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
"cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
@@ -598,7 +600,8 @@ macro (OCCT_UPDATE_TARGET_FILE)
string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\")
endforeach()
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_INSERT_CODE_FOR_TARGET)
@@ -612,14 +615,17 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
endmacro()
macro (OCCT_UPDATE_DRAW_DEFAULT_FILE)
install(CODE "set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
install(CODE "cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
file (STRINGS \"\${DRAW_DEFAULT_FILE_NAME}\" DRAW_DEFAULT_CONTENT)
file (REMOVE \"\${DRAW_DEFAULT_FILE_NAME}\")
foreach (line IN LISTS DRAW_DEFAULT_CONTENT)
string (REGEX MATCH \": TK\([a-zA-Z]+\)$\" IS_TK_LINE \"\${line}\")
string (REGEX REPLACE \": TK\([a-zA-Z]+\)$\" \": TK\${CMAKE_MATCH_1}${BUILD_SHARED_LIBRARY_NAME_POSTFIX}\" line \"\${line}\")
file (APPEND \"\${DRAW_DEFAULT_FILE_NAME}\" \"\${line}\\n\")
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)

View File

@@ -320,10 +320,10 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
add_definitions (-DHAVE_GLES2)
endif()

View File

@@ -69,12 +69,12 @@ else()
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# common steps for tbb12 and tbbmalloc
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
string (TOUPPER ${PRODUCT_LIBRARY_NAME} upper_PRODUCT_LIBRARY_NAME)
# define required tbb12/tbbmalloc variables
# define required tbb/tbbmalloc variables
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
@@ -126,7 +126,7 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME intel64)
endif()
# tbb12/tbbmalloc library
# tbb/tbbmalloc library
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
@@ -178,7 +178,7 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
# tbb12/tbbmalloc shared library
# tbb/tbbmalloc shared library
if (WIN32)
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
@@ -230,7 +230,7 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
endif()
endif()
# install tbb12/tbbmalloc
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
@@ -286,9 +286,9 @@ endmacro()
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB12_DLL_DIR})
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB12_LIBRARY_DIR})
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif()
#endif()

View File

@@ -775,19 +775,19 @@ proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir/$aVcLib"
}
if { "$aTbbLibPath" == "" } {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}tbb12.${::SYS_LIB_SUFFIX}' not found (Intel TBB)"
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}tbb.${::SYS_LIB_SUFFIX}' not found (Intel TBB)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
if { "$aTbbDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
if { "$aTbbDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/$aVcLib"
} else {
lappend anErrBin$anArchIter "Error: 'tbb12.dll' not found (Intel TBB)"
lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}

View File

@@ -1437,7 +1437,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
set aLibsMap(CSF_FFmpeg) "avcodec avformat swscale avutil"
}
if { "$::HAVE_TBB" == "true" } {
set aLibsMap(CSF_TBB) "tbb12 tbbmalloc"
set aLibsMap(CSF_TBB) "tbb tbbmalloc"
}
if { "$::HAVE_VTK" == "true" } {
if { "$theOS" == "wnt" } {

View File

@@ -23,7 +23,7 @@ CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb12 -ltbbmalloc }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
HAVE_DRACO { CSF_Draco = -ldraco }

View File

@@ -11,7 +11,7 @@ if /I "%VCVER%" == "@COMPILER@" (
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIRS@"
set "EGL_DIR=@3RDPARTY_EGL_DLL_DIRS@"
set "GLES2_DIR=@3RDPARTY_GLES2_DLL_DIRS@"
set "TBB_DIR=@3RDPARTY_TBB12_DLL_DIR@"
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
set "FFMPEG_DIR=@3RDPARTY_FFMPEG_DLL_DIR@"
set "OPENVR_DIR=@3RDPARTY_OPENVR_DLL_DIRS@"

View File

@@ -9,7 +9,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TK_DIR="@3RDPARTY_TK_LIBRARY_DIR@"
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIRS@"
export TBB_DIR="@3RDPARTY_TBB12_LIBRARY_DIR@"
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
export FFMPEG_DIR="@3RDPARTY_FFMPEG_LIBRARY_DIR@"

View File

@@ -128,9 +128,8 @@ You can download its sources from https://freetype.org/
@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/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Windows platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-win.zip`)
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.
@@ -305,9 +304,9 @@ Download the necessary archive from https://freetype.org/ and unpack it.
@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/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-lin.tgz`).
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
@@ -478,9 +477,9 @@ Download the necessary archive from https://freetype.org/ and unpack it.
@subsection dev_guides__building_3rdparty_osx_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-mac.tgz`).
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

View File

@@ -17,7 +17,7 @@ On Linux and macOS we recommend to use libraries maintained by distributive deve
@section build_occt_win_cmake Building with CMake tool
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources.
OCCT requires CMake version 3.1 or later.
OCCT requires CMake version 2.8.12 or later.
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
@@ -113,7 +113,6 @@ The following table gives the full list of environment variables used at the con
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| BUILD_CPP_STANDARD | String | Employ corresponding c++ standard (C++11, C++14, ..C++23) for building OCCT |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |

View File

@@ -359,8 +359,8 @@ https://dev.opencascade.org/resources/download/3rd-party-components
| Component | Where to find | Used for | Purpose |
| --------- | ------------- | -------- | -------------------- |
| CMake 3.1+ | https://cmake.org/ | Configuration | Build from sources |
| Intel oneTBB 2021.5.0 | https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0 | All | Parallelization of algorithms (alternative to built-in thread pool) |
| CMake 2.8+ | https://cmake.org/ | Configuration | Build from sources |
| Intel TBB 4.x or later | https://oneapi-src.github.io/oneTBB/ | All | Parallelization of algorithms (alternative to built-in thread pool) |
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required for using 3D Viewer |
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | VR (Virtual Reality) support in 3D Viewer |
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Text rendering in 3D Viewer |
@@ -572,7 +572,7 @@ FreeType 2 is released under two open-source licenses: BSD-like FreeType License
It is a library that helps you to take advantage of multi-core processor performance without having to be a threading expert.
Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that
abstracts platform details and threading mechanisms for scalability and performance.
oneTBB 2021.5.0 is available under Apache 2.0 license, while older versions
TBB version 2017 is available under Apache 2.0 license, while older versions
until 4.4 are available under GPLv2 license with the runtime exception (https://www.threadingbuildingblocks.org).
**OpenGL** is an industry standard API for 3D graphics used by OCCT for

View File

@@ -91,7 +91,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy.dll</OutputFile>
@@ -122,7 +121,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy.dll</OutputFile>
@@ -147,7 +145,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy.dll</OutputFile>
@@ -175,7 +172,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy.dll</OutputFile>

View File

@@ -92,7 +92,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
@@ -124,7 +123,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
@@ -149,7 +147,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
@@ -177,7 +174,6 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ConformanceMode>false</ConformanceMode>
</ClCompile>
<Link>
<OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IE_WPF_D3D</RootNamespace>
<AssemblyName>IE_WPF_D3D</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IE_WPF_WinForms</RootNamespace>
<AssemblyName>IE_WPF_WinForms</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -27,7 +27,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>

View File

@@ -35,4 +35,4 @@
</providers>
</roleManager>
</system.web>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -55,7 +55,7 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
return;
}
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor, 1.e-2);
if (anEdgeDistrib.IsDone())
{
@@ -72,9 +72,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve)
if (anAdaptor->GetType() == GeomAbs_BezierCurve)
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for (int i = 1; i <= aBezier->NbPoles(); i++)
{
@@ -87,9 +87,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
aPrsGroup->AddPrimitiveArray(anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve)
if (anAdaptor->GetType() == GeomAbs_BSplineCurve)
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
for (int i = 1; i <= aBSpline->NbPoles(); i++)
{
@@ -103,11 +103,11 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
const Standard_Integer nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
const Standard_Integer nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1, nbintv + 1);
anAdaptor.Intervals(TI, GeomAbs_CN);
anAdaptor->Intervals(TI, GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -30,7 +30,7 @@ void AdaptorCurve_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -1840,7 +1840,7 @@ void GeometrySamples::BoundingBoxOfSurface3dSample()
// Compute BSpline surface bounding box.
Bnd_Box aBndBox;
BndLib_AddSurface::AddOptimal(GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
BndLib_AddSurface::AddOptimal(new GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "
@@ -1881,7 +1881,7 @@ void GeometrySamples::BoundingBoxOfCurves3dSample()
// Compute BSpline curve bounding box.
Bnd_Box aBndBox;
BndLib_Add3dCurve::AddOptimal(GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
BndLib_Add3dCurve::AddOptimal(new GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "

View File

@@ -102,7 +102,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Current());
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -153,7 +153,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
if (!aTrimmedCurve.IsNull())
{
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib (aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -253,7 +253,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager)& ,
// make a 3D curve from 2D trimmed curve to display it
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
// make distribution of points
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (anEdgeDistrib.IsDone())
{

View File

@@ -4,6 +4,7 @@ project(glfw-occt-demo)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/adm/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(APP_TARGET glfwocct)

View File

@@ -39,9 +39,9 @@ elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
set (MY_COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (MY_COMPILER gcc)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (MY_COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (MY_COMPILER icc)
else()
set (MY_COMPILER ${CMAKE_GENERATOR})

View File

@@ -37,7 +37,7 @@ list(APPEND aLibDeps lib_FreeType)
# system libraries
list(APPEND aLibDeps EGL GLESv2 log android)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -frtti -fexceptions -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -frtti -fexceptions -fpermissive")
add_library(TKJniSample SHARED ${SOURCE_FILES})
target_link_libraries(TKJniSample ${aLibDeps})

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (Geometry)

View File

@@ -655,7 +655,7 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real startparam = 10*M_PI/180;
Standard_Real abscissa = 45*M_PI/180;
gp_Pnt2d P1;
@@ -668,23 +668,23 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
//==============================================================
TCollection_AsciiString Message (" \n\
\n\
\n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Standard_Real startparam = 10*PI180; \n\
Standard_Real abscissa = 45*PI180; \n\
gp_Pnt2d P1; \n\
C->D0(startparam,P1); \n\
// abscissa is the distance along the curve from startparam \n\
GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); \n\
gp_Pnt2d P2; \n\
if (AP.IsDone()){C->D0(AP.Parameter(),P2);} \n\
// P is now correctly set \n\
\n\
\n");
\n\
\n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real startparam = 10*PI180; \n\
Standard_Real abscissa = 45*PI180; \n\
gp_Pnt2d P1; \n\
C->D0(startparam,P1); \n\
// abscissa is the distance along the curve from startparam \n\
GCPnts_AbscissaPoint AP (GAC, abscissa, startparam); \n\
gp_Pnt2d P2; \n\
if (AP.IsDone()){C->D0(AP.Parameter(),P2);} \n\
// P is now correctly set \n\
\n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------
Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C);
@@ -723,7 +723,7 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real abscissa = 3;
GCPnts_UniformAbscissa UA (GAC,abscissa);
TColgp_SequenceOfPnt2d aSequence;
@@ -743,29 +743,29 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
//==============================================================
TCollection_AsciiString Message (" \
\n\
gp_Pnt2d P; \n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Standard_Real abscissa = 3; \n\
GCPnts_UniformAbscissa UA (GAC,abscissa); \n\
TColgp_SequenceOfPnt2d aSequence; \n\
if (UA.IsDone()) \n\
{ \n\
Standard_Real N = UA.NbPoints(); \n\
Standard_Integer count = 1; \n\
for(;count<=N;count++) \n\
{ \n\
C->D0(UA.Parameter(count),P); \n\
Standard_Real Parameter = UA.Parameter(count); \n\
// append P in a Sequence \n\
aSequence.Append(P); \n\
} \n\
} \n\
Standard_Real Abscissa = UA.Abscissa(); \n\
\n");
\n\
gp_Pnt2d P; \n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real abscissa = 3; \n\
GCPnts_UniformAbscissa UA (GAC,abscissa); \n\
TColgp_SequenceOfPnt2d aSequence; \n\
if (UA.IsDone()) \n\
{ \n\
Standard_Real N = UA.NbPoints(); \n\
Standard_Integer count = 1; \n\
for(;count<=N;count++) \n\
{ \n\
C->D0(UA.Parameter(count),P); \n\
Standard_Real Parameter = UA.Parameter(count); \n\
// append P in a Sequence \n\
aSequence.Append(P); \n\
} \n\
} \n\
Standard_Real Abscissa = UA.Abscissa(); \n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------
Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(C);
@@ -3895,21 +3895,21 @@ void GeomSources::gpTest48(CGeometryDoc* aDoc)
Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve();
Bnd_Box2d aCBox;
Geom2dAdaptor_Curve GACC (C);
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C);
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox);
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax;
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax);
Bnd_Box2d aSPL1Box;
Geom2dAdaptor_Curve GAC1 (SPL1);
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1);
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box);
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax;
aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax);
Bnd_Box2d aSPL2Box;
Geom2dAdaptor_Curve GAC2 (SPL2);
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2);
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box);
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax;
@@ -3930,14 +3930,14 @@ Handle(Geom2d_BSplineCurve) SPL1 ; // SPL1 = ... \n\
Handle(Geom2d_BSplineCurve) SPL2 ; // SPL2 = ... \n\
\n\
Bnd_Box2d aCBox; \n\
Geom2dAdaptor_Curve GACC (C); \n\
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C); \n\
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox); \n\
\n\
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax; \n\
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax); \n\
\n\
Bnd_Box2d aSPL1Box; \n\
Geom2dAdaptor_Curve GAC1 (SPL1); \n\
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1); \n\
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box); \n\
\n\
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax; \n\
@@ -3945,7 +3945,7 @@ aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax); \n");
Message += "\
\n\
Bnd_Box2d aSPL2Box; \n\
Geom2dAdaptor_Curve GAC2 (SPL2); \n\
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2); \n\
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box); \n\
\n\
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax; \n\
@@ -4005,7 +4005,7 @@ void GeomSources::gpTest49(CGeometryDoc* aDoc)
Handle(Geom_Circle) C =
new Geom_Circle(anAxis,radius);
GeomAdaptor_Curve GAC (C);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C);
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ;
@@ -4021,7 +4021,7 @@ gp_Ax2 anAxis(gp_Pnt(0,0,0),gp_Dir(1,2,-5)); \n\
\n\
Handle(Geom_Circle) C = \n\
new Geom_Circle(anAxis,radius); \n\
GeomAdaptor_Curve GAC (C); \n\
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C); \n\
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
@@ -4097,7 +4097,7 @@ void GeomSources::gpTest50(CGeometryDoc* aDoc)
GeomFill_FillingStyle Type = GeomFill_StretchStyle;
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type);
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface();
GeomAdaptor_Surface GAS (aSurf);
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf);
Bnd_Box aBox;
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox);
@@ -4122,19 +4122,19 @@ array2.SetValue(2,gp_Pnt (-20, 20, 0)); \n\
array2.SetValue(3,gp_Pnt ( 20, 30,-10)); \n\
array2.SetValue(4,gp_Pnt ( 30, 70,-20)); \n\
array2.SetValue(5,gp_Pnt ( 40, 90,-10)); \n\
Handle(Geom_BSplineCurve) SPL2 = \n\
Handle(Geom_BSplineCurve) SPL2 = \n\
GeomAPI_PointsToBSpline(array2).Curve(); \n\
\n\
GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\
GeomAdaptor_Surface GAS (aSurf); \n\
Bnd_Box aBox; \n\
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\
\n");
\n\
GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf); \n\
Bnd_Box aBox; \n\
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------

View File

@@ -34,7 +34,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor,1.e-2);
if(anEdgeDistrib.IsDone())
{
@@ -48,9 +48,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve )
if (anAdaptor->GetType() == GeomAbs_BezierCurve )
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for(int i=1;i<=aBezier->NbPoles();i++)
{
@@ -60,9 +60,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->AddPrimitiveArray (anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve )
if (anAdaptor->GetType() == GeomAbs_BSplineCurve )
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
@@ -76,12 +76,12 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
Standard_Integer ii;
Standard_Integer intrv, nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
Standard_Integer intrv, nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1,nbintv+1);
anAdaptor.Intervals(TI,GeomAbs_CN);
anAdaptor->Intervals(TI,GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -18,7 +18,7 @@ void ISession_Curve::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve (myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -22,8 +22,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Surface anAdaptorSurface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorSurface = new GeomAdaptor_Surface (mySurface);
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
aPoleDrawer->SetOwnLineAspects();
@@ -41,7 +40,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
}
case 0:
{
StdPrs_WFSurface::Add (thePrs, anAdaptorHSurface, myDrawer);
StdPrs_WFSurface::Add (thePrs, anAdaptorSurface, myDrawer);
break;
}
}

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (Modeling)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (ImportExport)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (HLR)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (mfcsample)

View File

@@ -51,7 +51,7 @@ unix {
DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
!macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
LIBS += -lfreeimageplus
LIBS += -ltbb12 -ltbbmalloc
LIBS += -ltbb -ltbbmalloc
QMAKE_CXXFLAGS += -std=gnu++11
}

View File

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.2)
project(occt-webgl-sample)
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(APP_TARGET occt-webgl-sample)

View File

@@ -188,7 +188,7 @@ void AIS_Axis::Compute (const Handle(PrsMgr_PresentationManager)& ,
thePrs->SetInfiniteState (myInfiniteState);
if (!myIsXYZAxis)
{
GeomAdaptor_Curve curv (myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add (thePrs, curv, myDrawer);
}
else

View File

@@ -211,7 +211,7 @@ void AIS_Circle::UnsetWidth()
void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);
@@ -226,7 +226,7 @@ void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentatio
//=======================================================================
void AIS_Circle::ComputeArc (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent, myUStart, myUEnd);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent, myUStart, myUEnd);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);

View File

@@ -211,7 +211,7 @@ void AIS_Line::UnsetWidth()
//=======================================================================
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
//pas de prise en compte lors du FITALL
@@ -230,7 +230,7 @@ void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentati
myComponent = new Geom_Line(P1,gp_Dir(P2.XYZ()-P1.XYZ()));
Standard_Real dist = P1.Distance(P2);
GeomAdaptor_Curve curv(myComponent,0.,dist);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent,0.,dist);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
}

View File

@@ -222,7 +222,7 @@ void AIS_Plane::Compute (const Handle(PrsMgr_PresentationManager)& ,
ComputeFrame();
const Handle(Geom_Plane)& pl = myComponent;
Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
GeomAdaptor_Surface surf(thegoodpl);
Handle(GeomAdaptor_Surface) surf = new GeomAdaptor_Surface(thegoodpl);
StdPrs_Plane::Add (thePrs, surf, myDrawer);
}
else

View File

@@ -93,7 +93,7 @@ static void findfourpoints(const Standard_Real ,
}
}
/*static Standard_Real curvature(const Standard_Real U, const Adaptor3d_Curve& C)
/*static Standard_Real curvature(const Standard_Real U, const Handle(Adaptor3d_Curve)& C)
{
Standard_Real k, tau, mod1, mod2, OMEGA;
gp_Pnt P;
@@ -151,34 +151,40 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor2d_Curve2d)& C2D1, co
void Approx_CurvlinFunc::Init()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch(myCase) {
case 1:
Init (*myC3D, mySi_1, myUi_1);
myFirstU1 = myC3D->FirstParameter();
myLastU1 = myC3D->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
{
Init(myC3D, mySi_1, myUi_1);
myFirstU1 = myC3D->FirstParameter();
myLastU1 = myC3D->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
myFirstU2 = myLastU2 = 0;
break;
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
Init(CurOnSur, mySi_2, myUi_2);
myFirstU2 = CurOnSur.FirstParameter();
myLastU2 = CurOnSur.LastParameter();
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
Init(CurOnSur, mySi_2, myUi_2);
myFirstU2 = CurOnSur->FirstParameter();
myLastU2 = CurOnSur->LastParameter();
}
}
Length();
@@ -190,20 +196,20 @@ void Approx_CurvlinFunc::Init()
//purpose : Init the values
//history : 23/10/1998 PMN : Cut at curve's discontinuities
//=======================================================================
void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
void Approx_CurvlinFunc::Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
{
Standard_Real Step, FirstU, LastU;
Standard_Integer i, j, k, NbInt, NbIntC3;
FirstU = C.FirstParameter();
LastU = C.LastParameter();
FirstU = C->FirstParameter();
LastU = C->LastParameter();
NbInt = 10;
NbIntC3 = C.NbIntervals(GeomAbs_C3);
NbIntC3 = C->NbIntervals(GeomAbs_C3);
TColStd_Array1OfReal Disc(1, NbIntC3+1);
if (NbIntC3 >1) {
C.Intervals(Disc, GeomAbs_C3);
C->Intervals(Disc, GeomAbs_C3);
}
else {
Disc(1) = FirstU;
@@ -325,46 +331,44 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
if ((Last - First) < Tol) return;
Standard_Real FirstU, LastU;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) HCurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Handle(Adaptor3d_CurveOnSurface) TCurOnSur;
switch(myCase) {
case 1:
myC3D = myC3D->Trim(myFirstU1, myLastU1, Tol);
FirstU = GetUParameter(*myC3D, First, 1);
LastU = GetUParameter (*myC3D, Last, 1);
FirstU = GetUParameter(myC3D, First, 1);
LastU = GetUParameter (myC3D, Last, 1);
myC3D = myC3D->Trim(FirstU, LastU, Tol);
break;
case 3:
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU2, myLastU2, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU2, myLastU2, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
Standard_FALLTHROUGH
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU1, myLastU1, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU1, myLastU1, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
}
myFirstS = First;
myLastS = Last;
@@ -372,41 +376,39 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
void Approx_CurvlinFunc::Length()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Standard_Real FirstU, LastU;
switch(myCase){
case 1:
FirstU = myC3D->FirstParameter();
LastU = myC3D->LastParameter();
myLength = Length (*myC3D, FirstU, LastU);
myLength = Length (myC3D, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength = Length(CurOnSur, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength1 = Length(CurOnSur, FirstU, LastU);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength2 = Length(CurOnSur, FirstU, LastU);
myLength = (myLength1 + myLength2)/2;
}
}
Standard_Real Approx_CurvlinFunc::Length(Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LastU) const
Standard_Real Approx_CurvlinFunc::Length(const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LastU) const
{
Standard_Real Length;
@@ -423,24 +425,22 @@ Standard_Real Approx_CurvlinFunc::GetLength() const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
{
Standard_Real S=0, S1, S2;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch (myCase) {
case 1:
S = GetSParameter (*myC3D, U, myLength);
S = GetSParameter (myC3D, U, myLength);
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S = GetSParameter(CurOnSur, U, myLength);
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
S1 = GetSParameter(CurOnSur, U, myLength1);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
S2 = GetSParameter(CurOnSur, U, myLength2);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S1 = GetSParameter(CurOnSur, U, myLength1);
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
S2 = GetSParameter(CurOnSur, U, myLength2);
S = (S1 + S2)/2;
}
return S;
@@ -448,9 +448,9 @@ Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
Standard_Real Approx_CurvlinFunc::GetUParameter (const Handle(Adaptor3d_Curve)& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
{
Standard_Real deltaS, base, U, Length;
Standard_Integer NbInt, NInterval, i;
@@ -513,12 +513,12 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
return U;
}
Standard_Real Approx_CurvlinFunc::GetSParameter(Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Len) const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Len) const
{
Standard_Real S, Origin;
Origin = C.FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
Origin = C->FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
return S;
}
@@ -530,7 +530,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Stan
gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2;
Standard_Real U, Mag, dU_dS, d2U_dS2;
U = GetUParameter (*myC3D, S, 1);
U = GetUParameter (myC3D, S, 1);
switch(Order) {
@@ -612,16 +612,16 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S
if (NumberOfCurve == 1) {
Cur2D = myC2D1;
Surf = mySurf1;
Adaptor3d_CurveOnSurface CurOnSur(myC2D1, mySurf1);
Surf = mySurf1;
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
U = GetUParameter(CurOnSur, S, 1);
if(myCase == 3) Length = myLength1;
else Length = myLength;
}
else if (NumberOfCurve == 2) {
Cur2D = myC2D2;
Surf = mySurf2;
Adaptor3d_CurveOnSurface CurOnSur(myC2D2, mySurf2);
Surf = mySurf2;
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
U = GetUParameter(CurOnSur, S, 2);
Length = myLength2;
}

View File

@@ -64,14 +64,14 @@ public:
Standard_EXPORT void Length();
//! Computes length of the curve segment.
Standard_EXPORT Standard_Real Length (Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real Length (const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real GetLength() const;
//! returns original parameter corresponding S. if
//! Case == 1 computation is performed on myC2D1 and mySurf1,
//! otherwise it is done on myC2D2 and mySurf2.
Standard_EXPORT Standard_Real GetUParameter (Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
Standard_EXPORT Standard_Real GetUParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
//! returns original parameter corresponding S.
Standard_EXPORT Standard_Real GetSParameter (const Standard_Real U) const;
@@ -100,10 +100,10 @@ private:
Standard_EXPORT void Init();
Standard_EXPORT void Init (Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
Standard_EXPORT void Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
//! returns curvilinear parameter corresponding U.
Standard_EXPORT Standard_Real GetSParameter (Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Real GetSParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Boolean EvalCurOnSur (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result, const Standard_Integer NumberOfCurve) const;

View File

@@ -111,7 +111,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
const gp_Pnt& APoint,
const Standard_Real Tolerance,
const Standard_Integer NumIteration,
const Adaptor3d_Curve& Curve,
const Handle(Adaptor3d_Curve)& Curve,
Standard_Boolean& Status,
Standard_Real& Result)
{
@@ -125,7 +125,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
do
{
num_iter++;
Curve.D2(param, a_point, d1, d2);
Curve->D2(param, a_point, d1, d2);
vector = gp_Vec(a_point,APoint);
func = vector.Dot(d1);
@@ -143,8 +143,8 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
if( Abs(func_derivative) > Toler )
param -= func / func_derivative;
param = Max(param,Curve.FirstParameter());
param = Min(param,Curve.LastParameter());
param = Max(param,Curve->FirstParameter());
param = Min(param,Curve->LastParameter());
}
} while (not_done && num_iter <= NumIteration);
@@ -156,7 +156,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
//purpose :
//=======================================================================
static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
const Standard_Integer nbp)
{
Standard_Real d2 = 0.0; // Square max discrete deviation.
@@ -170,7 +170,7 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
try
{
Pc3d = c3d->Value(u);
Pcons = cons.Value(u);
Pcons = cons->Value(u);
}
catch (Standard_Failure const&)
{
@@ -202,7 +202,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer nbp,
const Standard_Real *pc3d,
const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
Standard_Real& tol,
const Standard_Real oldtol)
{
@@ -217,8 +217,8 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
Standard_Real aParamFirst = 3.0 * pc3d[0] - 2.0 * pc3d[nbp - 1];
Standard_Real aParamLast = 3.0 * pc3d[nbp - 1] - 2.0 * pc3d[0];
Standard_Real FirstPar = cons.FirstParameter();
Standard_Real LastPar = cons.LastParameter();
Standard_Real FirstPar = cons->FirstParameter();
Standard_Real LastPar = cons->LastParameter();
if (aParamFirst < FirstPar)
aParamFirst = FirstPar;
if (aParamLast > LastPar)
@@ -247,7 +247,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
return Standard_False;
}
tprev = tcons;
gp_Pnt Pcons = cons.Value(tcons);
gp_Pnt Pcons = cons->Value(tcons);
Standard_Real temp = Pc3d.SquareDistance(Pcons);
if(temp > d2) d2 = temp;
}
@@ -337,9 +337,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// Create and fill data structure.
Approx_SameParameter_Data aData;
aData.myCOnS = Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS.FirstParameter();
aData.myC2dPL = aData.myCOnS.LastParameter();
aData.myCOnS = new Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS->FirstParameter();
aData.myC2dPL = aData.myCOnS->LastParameter();
aData.myC3dPF = myC3d->FirstParameter();
aData.myC3dPL = myC3d->LastParameter();
aData.myNbPnt = 0; // No points initially.
@@ -376,7 +376,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if(aData.myNbPnt < aNbPnt )
{
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
myDone = Standard_False;
return;
}
@@ -444,11 +444,11 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if (anApproximator.IsDone() || anApproximator.HasResult())
{
Adaptor3d_CurveOnSurface ACS = aData.myCOnS;
Handle(Adaptor3d_CurveOnSurface) ACS = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
const Standard_Real aMult = 250.0; // To be tolerant with discrete tolerance.
@@ -482,9 +482,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// using data from the last loop iteration or initial data. Use data set with minimal deflection.
// Original 2d curve.
aData.myCOnS.Load(myHCurve2d);
aData.myCOnS->Load(myHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
// Approximation curve.
Standard_Integer num_knots = aData.myNbPnt + 7;
@@ -515,7 +515,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
Standard_Real anApproxTol = ComputeTolReached(myC3d,aData.myCOnS,2 * myNbSamples);
if (anApproxTol < myTolReached)
@@ -527,7 +527,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
myDone = Standard_True;
}
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS.ShallowCopy());
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
}
//=======================================================================
@@ -643,18 +643,18 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
// Compute initial distance on boundary points.
gp_Pnt Pcons, Pc3d;
theData.myCOnS.D0(theData.myC2dPF, Pcons);
theData.myCOnS->D0(theData.myC2dPF, Pcons);
myC3d->D0(theData.myC3dPF, Pc3d);
Standard_Real dist2 = Pcons.SquareDistance(Pc3d);
Standard_Real dmax2 = dist2;
theData.myCOnS.D0(theData.myC2dPL, Pcons);
theData.myCOnS->D0(theData.myC2dPL, Pcons);
myC3d->D0(theData.myC3dPL, Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
dmax2 = Max(dmax2, dist2);
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Projector.Initialize (myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Standard_Integer count = 1;
Standard_Real previousp = theData.myC3dPF, initp=0, curp;
@@ -662,7 +662,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
Standard_Boolean isProjOk = Standard_False;
for (Standard_Integer ii = 1; ii < theData.myNbPnt; ii++)
{
theData.myCOnS.D0(theData.myPC2d[ii],Pcons);
theData.myCOnS->D0(theData.myPC2d[ii],Pcons);
myC3d->D0(theData.myPC3d[ii],Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
@@ -692,7 +692,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
else
{
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, *myC3d,isProjOk,curp);
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, myC3d,isProjOk,curp);
}
isProjOk = isProjOk && // Good projection.
curp > previousp + myDeltaMin && // Point is separated from previous.
@@ -706,7 +706,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
// Whole parameter space search using general extrema.
Extrema_ExtPC PR(Pcons, *myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Extrema_ExtPC PR(Pcons, myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
if (!PR.IsDone() || PR.NbExt() == 0) // Lazy evaluation is used.
continue;
@@ -747,7 +747,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
//function : ComputeTangents
//purpose : Sub-method in Build.
//=======================================================================
Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean Approx_SameParameter::ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const
{
@@ -758,7 +758,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// First point.
const Standard_Real aParamFirst = myC3d->FirstParameter();
theCOnS.D1(aParamFirst, aPntCOnS, aVecConS);
theCOnS->D1(aParamFirst, aPntCOnS, aVecConS);
myC3d->D1(aParamFirst, aPnt, aVec);
Standard_Real aMagnitude = aVecConS.Magnitude();
if (aMagnitude > aSmallMagnitude)
@@ -768,7 +768,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// Last point.
const Standard_Real aParamLast = myC3d->LastParameter();
theCOnS.D1(aParamLast,aPntCOnS,aVecConS);
theCOnS->D1(aParamLast,aPntCOnS,aVecConS);
myC3d->D1(aParamLast, aPnt, aVec);
aMagnitude = aVecConS.Magnitude();
@@ -834,7 +834,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real &theBestSqTol) const
{
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Projector.Initialize (myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Standard_Real curp = 0.0;
Standard_Boolean projok = Standard_False;
@@ -862,7 +862,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[ii]+theData.myPC3d[ii+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -873,7 +873,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{
@@ -910,7 +910,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[n]+theData.myPC3d[n+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -921,7 +921,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{

View File

@@ -103,7 +103,7 @@ private:
//! a lot of memory is used in intermediate computations.
struct Approx_SameParameter_Data
{
Adaptor3d_CurveOnSurface myCOnS; // Curve on surface.
Handle(Adaptor3d_CurveOnSurface) myCOnS; // Curve on surface.
Standard_Integer myNbPnt; // Number of points.
Standard_Real *myPC3d; // Parameters on 3d curve.
Standard_Real *myPC2d; // Parameters on 2d curve.
@@ -155,7 +155,7 @@ private:
//! Computes tangents on boundary points.
//@return true if tangents are not null and false otherwise.
Standard_Boolean ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const;

View File

@@ -640,7 +640,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
{
// At this stage, context should contain adaptor for all intersected faces,
// so getting a type of the underlying surface should be done at no cost.
if (myContext->SurfaceAdaptor(TopoDS::Face(aF)).GetType() == GeomAbs_Plane)
if (myContext->SurfaceAdaptor(TopoDS::Face(aF))->GetType() == GeomAbs_Plane)
{
// Check bounding box of the face - it should not be open in any side
const Bnd_Box& aBox = aSI.Box();

View File

@@ -889,7 +889,7 @@ Standard_Boolean BOPAlgo_PaveFiller::GetPBBox(const TopoDS_Edge& theE,
}
else {
// build bounding box
BRepAdaptor_Curve aBAC(theE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theE);
Standard_Real aTol = BRep_Tool::Tolerance(theE) + Precision::Confusion();
BndLib_Add3dCurve::Add(aBAC, theSFirst, theSLast, aTol, theBox);
thePBBox.Bind(thePB, theBox);

View File

@@ -373,9 +373,9 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
//
Standard_Boolean bLinePlane = Standard_False;
if (aNbCPrts) {
BRepAdaptor_Curve aBAC(aE);
bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF).GetType() == GeomAbs_Plane);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
bLinePlane = (aBAC->GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF)->GetType() == GeomAbs_Plane);
}
//
for (i=1; i<=aNbCPrts; ++i) {
@@ -916,7 +916,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
// Projection tool
GeomAPI_ProjectPointOnSurf& aProjPS = myContext->ProjPS(aF);
BRepAdaptor_Surface& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
const Handle(BRepAdaptor_Surface)& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
// Iterate on pave blocks and combine pairs containing
// the same vertices
@@ -996,7 +996,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
if (!myContext->IsPointInFace(aF, gp_Pnt2d(U, V)))
continue;
if (aSurfAdaptor.GetType() != GeomAbs_Plane ||
if (aSurfAdaptor->GetType() != GeomAbs_Plane ||
aBAC.GetType() != GeomAbs_Line)
{
gp_Pnt aPOnS = aProjPS.NearestPoint();

View File

@@ -76,8 +76,8 @@
#include <TopTools_ListOfShape.hxx>
//
static Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2);
static Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2);
/////////////////////////////////////////////////////////////////////////
//=======================================================================
@@ -322,10 +322,10 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
const TopoDS_Face& aF1 = (*(TopoDS_Face *)(&myDS->Shape(nF1)));
const TopoDS_Face& aF2 = (*(TopoDS_Face *)(&myDS->Shape(nF2)));
//
const BRepAdaptor_Surface& aBAS1 = myContext->SurfaceAdaptor(aF1);
const BRepAdaptor_Surface& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1.GetType() == GeomAbs_Plane &&
aBAS2.GetType() == GeomAbs_Plane) {
const Handle(BRepAdaptor_Surface)& aBAS1 = myContext->SurfaceAdaptor(aF1);
const Handle(BRepAdaptor_Surface)& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1->GetType() == GeomAbs_Plane &&
aBAS2->GetType() == GeomAbs_Plane) {
// Check if the planes are really interfering
Standard_Boolean bToIntersect = CheckPlanes(nF1, nF2);
if (!bToIntersect) {
@@ -347,8 +347,8 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
// Keep shift value to use it as the tolerance for intersection curves
Standard_Real aShiftValue = 0.;
if (aBAS1.GetType() != GeomAbs_Plane ||
aBAS2.GetType() != GeomAbs_Plane) {
if (aBAS1->GetType() != GeomAbs_Plane ||
aBAS2->GetType() != GeomAbs_Plane) {
Standard_Boolean isFound = Standard_False;
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
@@ -785,7 +785,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
//
// check if the pave block has a valid range
Standard_Real aFirst, aLast;
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
aT1, BRep_Tool::Pnt(aV1), Max (aTolR3D, BRep_Tool::Tolerance(aV1)),
aT2, BRep_Tool::Pnt(aV2), Max (aTolR3D, BRep_Tool::Tolerance(aV2)),
aFirst, aLast))
@@ -3176,7 +3176,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC)
// Check if there will be valid range on the curve
Standard_Real aFirst, aLast;
Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance());
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
aT[0], aP[0], aNewTolV,
aT[1], aP[1], aNewTolV,
aFirst, aLast))
@@ -3479,25 +3479,25 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges)
//purpose : Computes the TolFF according to the tolerance value and
// types of the faces.
//=======================================================================
Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2)
Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2)
{
Standard_Real aTol1 = aBAS1.Tolerance();
Standard_Real aTol2 = aBAS2.Tolerance();
Standard_Real aTol1 = aBAS1->Tolerance();
Standard_Real aTol2 = aBAS2->Tolerance();
Standard_Real aTolFF = Max(aTol1, aTol2);
//
Standard_Boolean isAna1, isAna2;
isAna1 = (aBAS1.GetType() == GeomAbs_Plane ||
aBAS1.GetType() == GeomAbs_Cylinder ||
aBAS1.GetType() == GeomAbs_Cone ||
aBAS1.GetType() == GeomAbs_Sphere ||
aBAS1.GetType() == GeomAbs_Torus);
isAna1 = (aBAS1->GetType() == GeomAbs_Plane ||
aBAS1->GetType() == GeomAbs_Cylinder ||
aBAS1->GetType() == GeomAbs_Cone ||
aBAS1->GetType() == GeomAbs_Sphere ||
aBAS1->GetType() == GeomAbs_Torus);
//
isAna2 = (aBAS2.GetType() == GeomAbs_Plane ||
aBAS2.GetType() == GeomAbs_Cylinder ||
aBAS2.GetType() == GeomAbs_Cone ||
aBAS2.GetType() == GeomAbs_Sphere ||
aBAS2.GetType() == GeomAbs_Torus);
isAna2 = (aBAS2->GetType() == GeomAbs_Plane ||
aBAS2->GetType() == GeomAbs_Cylinder ||
aBAS2->GetType() == GeomAbs_Cone ||
aBAS2->GetType() == GeomAbs_Sphere ||
aBAS2->GetType() == GeomAbs_Torus);
//
if (!isAna1 || !isAna2) {
aTolFF = Max(aTolFF, 5.e-6);

View File

@@ -277,8 +277,8 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo {
}
else
{
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS.IsUPeriodic() || aBAS.IsVPeriodic())
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS->IsUPeriodic() || aBAS->IsVPeriodic())
{
// The curve already exists. Adjust it for periodic cases.
BOPTools_AlgoTools2D::AdjustPCurveOnSurf

View File

@@ -254,15 +254,15 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
const TopoDS_Face& aDF = (*(TopoDS_Face *)(&myDS->Shape(nFD)));
//
Standard_Real aTolV = BRep_Tool::Tolerance(aDV);
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(aDF);
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(aDF);
//
// 2D intersection tolerance should be computed as a resolution
// from the tolerance of vertex to resolve the touching cases
Standard_Real aTolInt = Precision::PConfusion();
// UResolution from the tolerance of the vertex
Standard_Real aURes = aBAS.UResolution(aTolV);
Standard_Real aURes = aBAS->UResolution(aTolV);
// VResolution from the tolerance of the vertex
Standard_Real aVRes = aBAS.VResolution(aTolV);
Standard_Real aVRes = aBAS->VResolution(aTolV);
//
aTolInt = Max(aTolInt, Max(aURes, aVRes));
//
@@ -279,8 +279,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
aTolCmp = Max(aTolCmp, (bUDir ? aURes : aVRes));
//
// Prepare adaptor for the degenerated edge for intersection
Geom2dAdaptor_Curve aGAC1;
aGAC1.Load(aC2DDE, aTD1, aTD2);
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve(aC2DDE, aTD1, aTD2);
//
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPBOut);
for (; aItLPB.More(); aItLPB.Next()) {
@@ -297,14 +296,14 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
}
//
// Prepare adaptor for the passing edge for intersection
Geom2dAdaptor_Curve aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
//
Handle(Geom2d_Line) aL2D = Handle(Geom2d_Line)::DownCast(aC2D);
if (!aL2D.IsNull()) {
aGAC2.Load(aC2D);
aGAC2->Load(aC2D);
}
else {
aGAC2.Load(aC2D, aT1, aT2);
aGAC2->Load(aC2D, aT1, aT2);
}
// Intersection
Geom2dInt_GInter aGInter(aGAC1, aGAC2, aTolInt, aTolInt);

View File

@@ -69,7 +69,7 @@ static
TopTools_MapOfShape& theMEdgesNoUniquePlane);
static
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane);
static
@@ -84,7 +84,7 @@ static
gp_Dir& theTgt);
static
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent);
//=======================================================================
@@ -410,7 +410,7 @@ Standard_Integer BOPAlgo_Tools::EdgesToWires(const TopoDS_Shape& theEdges,
aExp.Init(aSEdges, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
//
gp_Pln aPln;
if (FindPlane(aBAC, aPln)) {
@@ -773,7 +773,7 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
gp_Dir *pDTE = theDMEdgeTgt.ChangeSeek(theEdge);
if (!pDTE) {
gp_Vec aVTE;
BRepAdaptor_Curve aBAC(theEdge);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theEdge);
if (!FindEdgeTangent(aBAC, aVTE)) {
return Standard_False;
}
@@ -787,26 +787,26 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
//function : FindEdgeTangent
//purpose : Finds the tangent for the edge
//=======================================================================
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
// for the line the tangent is defined by the direction
if (theCurve.GetType() == GeomAbs_Line) {
theTangent = theCurve.Line().Position().Direction();
if (theCurve->GetType() == GeomAbs_Line) {
theTangent = theCurve->Line().Position().Direction();
return Standard_True;
}
//
// for other curves take D1 and check for its length
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP;
theCurve.D1(aT, aP, theTangent);
theCurve->D1(aT, aP, theTangent);
if (theTangent.Magnitude() > Precision::Confusion()) {
return Standard_True;
}
@@ -819,47 +819,47 @@ Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
//function : FindPlane
//purpose : Finds the plane in which the edge is located
//=======================================================================
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
//
Standard_Boolean bFound = Standard_True;
gp_Vec aVN;
switch (theCurve.GetType()) {
switch (theCurve->GetType()) {
case GeomAbs_Line:
return Standard_False;
case GeomAbs_Circle:
aVN = theCurve.Circle().Position().Direction();
aVN = theCurve->Circle().Position().Direction();
break;
case GeomAbs_Ellipse:
aVN = theCurve.Ellipse().Position().Direction();
aVN = theCurve->Ellipse().Position().Direction();
break;
case GeomAbs_Hyperbola:
aVN = theCurve.Hyperbola().Position().Direction();
aVN = theCurve->Hyperbola().Position().Direction();
break;
case GeomAbs_Parabola:
aVN = theCurve.Parabola().Position().Direction();
aVN = theCurve->Parabola().Position().Direction();
break;
default: {
// for all other types of curve compute two tangent vectors
// on the curve and cross them
bFound = Standard_False;
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
aT = aT1;
gp_Pnt aP1;
gp_Vec aV1;
theCurve.D1(aT, aP1, aV1);
theCurve->D1(aT, aP1, aV1);
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP2;
gp_Vec aV2;
theCurve.D1(aT, aP2, aV2);
theCurve->D1(aT, aP2, aV2);
//
aVN = aV1^aV2;
if (aVN.Magnitude() > Precision::Confusion()) {
@@ -872,7 +872,7 @@ Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
}
//
if (bFound) {
thePlane = gp_Pln(theCurve.Value(theCurve.FirstParameter()), gp_Dir(aVN));
thePlane = gp_Pln(theCurve->Value(theCurve->FirstParameter()), gp_Dir(aVN));
}
return bFound;
}
@@ -935,7 +935,7 @@ Standard_Boolean FindPlane(const TopoDS_Shape& theWire,
if (theMEdgesNoUniquePlane.Contains(aE)) {
continue;
}
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
if (FindPlane(aBAC, thePlane)) {
return Standard_True;
}

View File

@@ -56,7 +56,7 @@ static
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean aFlag,
const Handle(IntTools_Context)& theContext);
@@ -86,7 +86,7 @@ static
const Standard_Real aAngleOut);
static
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVa,
@@ -103,16 +103,16 @@ static
static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
void RefineAngles(const TopoDS_Face& myFace,
@@ -293,8 +293,8 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
}
//
// 3. Angles in mySmartMap
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(myFace);
const GeomAdaptor_Surface& aGAS=aBAS.Surface();
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(myFace);
const Handle(GeomAdaptor_Surface)& aGAS = aBAS->Surface();
//
for (i=1; i<=aNb; i++) {
const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&mySmartMap.FindKey(i)));
@@ -351,7 +351,7 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
// function: Path
// purpose:
//=======================================================================
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVFirst,
@@ -740,7 +740,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean bIsIN,
const Handle(IntTools_Context)& theContext)
{
@@ -825,16 +825,16 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
// purpose:
//=======================================================================
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
Standard_Real aTol2D, anUr, aVr, aTolV3D;
GeomAbs_SurfaceType aType;
//
aType=aGAS.GetType();
aType=aGAS->GetType();
aTolV3D=BRep_Tool::Tolerance(aV);
anUr=aGAS.UResolution(aTolV3D);
aVr =aGAS.VResolution(aTolV3D);
anUr=aGAS->UResolution(aTolV3D);
aVr =aGAS->VResolution(aTolV3D);
aTol2D=(aVr>anUr) ? aVr : anUr;
//
if (aTol2D < aTolV3D) {
@@ -852,10 +852,10 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
//purpose :
//=======================================================================
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anUr = aGAS.UResolution(aTolV3D);
const Standard_Real anUr = aGAS->UResolution(aTolV3D);
//
return anUr;
}
@@ -865,10 +865,10 @@ Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
//purpose :
//=======================================================================
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anVr = aGAS.VResolution(aTolV3D);
const Standard_Real anVr = aGAS->VResolution(aTolV3D);
//
return anVr;
}
@@ -1011,7 +1011,8 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Pnt2d aPV, aP, aP1, aP2;
Handle(Geom2d_Curve) aC2D;
Handle(Geom2d_Line) aLi;
Geom2dAdaptor_Curve aGAC1, aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
Geom2dInt_GInter aGInter;
IntRes2d_Domain aDomain1, aDomain2;
//
@@ -1020,16 +1021,16 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
aTolInt=1.e-10;
//
BOPTools_AlgoTools2D::CurveOnSurface(aE, myFace, aC2D, aT1, aT2, aTol, theContext);
aGAC1.Load(aC2D, aT1, aT2);
aGAC1->Load(aC2D, aT1, aT2);
//
aTV=BRep_Tool::Parameter (aV, aE, myFace);
aGAC1.D0(aTV, aPV);
aGAC1->D0(aTV, aPV);
//
aTOp = (fabs(aTV-aT1) < fabs(aTV-aT2)) ? aT2 : aT1;
//
const Standard_Real MaxDT = 0.3 * (aT2 - aT1);
aGAC1.D0(aT1, aP1);
aGAC1.D0(aT2, aP2);
aGAC1->D0(aT1, aP1);
aGAC1->D0(aT2, aP2);
aDomain1.SetValues(aP1, aT1, aTolInt, aP2, aT2, aTolInt);
//
for (i=0; i<2; ++i) {
@@ -1039,7 +1040,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Dir2d aDiri(aXi, aYi);
aLi=new Geom2d_Line(aPV, aDiri);
//
aGAC2.Load(aLi);
aGAC2->Load(aLi);
//
aGInter.Perform(aGAC1, aDomain1, aGAC2, aDomain2, aTolInt, aTolInt);
if (!aGInter.IsDone()) {
@@ -1067,7 +1068,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
}
//
aT = aT1max + aCf*dT;
aGAC1.D0(aT, aP);
aGAC1->D0(aT, aP);
gp_Vec2d aV2D(aPV, aP);
gp_Dir2d aDir2D(aV2D);
//

View File

@@ -1472,7 +1472,7 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
break; //xx
}
//
BRepAdaptor_Curve2d aBAC2D(aE, aFF);
Handle(BRepAdaptor_Curve2d) aBAC2D = new BRepAdaptor_Curve2d(aE, aFF);
aNbS=Geom2dInt_Geom2dCurveTool::NbSamples(aBAC2D);
if (aNbS>2) {
aNbS*=4;
@@ -1487,10 +1487,10 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
dU=-dU;
}
//
aBAC2D.D0(aU, aP2D0);
aBAC2D->D0(aU, aP2D0);
for(i=2; i<=aNbS; i++) {
aU=aU1+(i-1)*dU;
aBAC2D.D0(aU, aP2D1);
aBAC2D->D0(aU, aP2D1);
aP2D0.Coord(aX0, aY0);
aP2D1.Coord(aX1, aY1);
//
@@ -2152,26 +2152,26 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
}
//
// try to compute the minimal 3D step
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
Standard_Real aR = 0.;
GeomAbs_SurfaceType aSType = aBAS.GetType();
GeomAbs_SurfaceType aSType = aBAS->GetType();
switch (aSType) {
case GeomAbs_Cylinder: {
aR = aBAS.Cylinder().Radius();
aR = aBAS->Cylinder().Radius();
break;
}
case GeomAbs_Cone: {
gp_Lin aL(aBAS.Cone().Axis());
gp_Lin aL(aBAS->Cone().Axis());
aR = aL.Distance(aP);
break;
}
case GeomAbs_Sphere: {
aDtMin = Max(aDtMin, 5.e-4);
aR = aBAS.Sphere().Radius();
aR = aBAS->Sphere().Radius();
break;
}
case GeomAbs_Torus: {
aR = aBAS.Torus().MajorRadius();
aR = aBAS->Torus().MajorRadius();
break;
}
default:
@@ -2195,14 +2195,14 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
const BOPTools_CoupleOfShape& aCS = aIt.Value();
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aCS.Shape2()));
//
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
//
Standard_Real aUMin, aUMax, aVMin, aVMax;
theContext->UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
//
Standard_Real aDU = aUMax - aUMin;
if (aDU > 0.) {
Standard_Real aURes = aBAS.UResolution(aDtMax);
Standard_Real aURes = aBAS->UResolution(aDtMax);
if (2*aURes > aDU) {
break;
}
@@ -2210,7 +2210,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
//
Standard_Real aDV = aVMax - aVMin;
if (aDV > 0.) {
Standard_Real aVRes = aBAS.VResolution(aDtMax);
Standard_Real aVRes = aBAS->VResolution(aDtMax);
if (2*aVRes > aDV) {
break;
}

View File

@@ -251,24 +251,24 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(theF);
pBAS = theContext->SurfaceAdaptor(theF);
}
else {
aBASTmp.Initialize(theF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(theF, Standard_True);
pBAS = aBASTmp;
}
//
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(*pBAS, theFirst, theLast, theC2D, theC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(pBAS, theFirst, theLast, theC2D, theC2DA);
}
//=======================================================================
//function : AdjustPCurveOnFace
//purpose :
//=======================================================================
void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
(const BRepAdaptor_Surface& aBAS,
(const Handle(BRepAdaptor_Surface)& aBAS,
const Standard_Real aFirst,
const Standard_Real aLast,
const Handle(Geom2d_Curve)& aC2D,
@@ -278,11 +278,11 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real UMin, UMax, VMin, VMax, aT, u2, v2, du, dv, aDelta;
Standard_Real aUPeriod;
//
const TopoDS_Face& aF=aBAS.Face();
UMin=aBAS.FirstUParameter();
UMax=aBAS.LastUParameter();
VMin=aBAS.FirstVParameter();
VMax=aBAS.LastVParameter();
const TopoDS_Face& aF=aBAS->Face();
UMin=aBAS->FirstUParameter();
UMax=aBAS->LastUParameter();
VMin=aBAS->FirstVParameter();
VMax=aBAS->LastVParameter();
//
aDelta=Precision::PConfusion();
@@ -296,8 +296,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
//
// du
du = 0.;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
//
// a. try to clarify u2 using the precision (aDelta)
@@ -311,10 +311,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, u2, du, 0.);
//
if (du==0.) {
if (aBAS.GetType()==GeomAbs_Cylinder) {
if (aBAS->GetType()==GeomAbs_Cylinder) {
Standard_Real aR, dFi, aTol;
//
gp_Cylinder aCylinder=aBAS.Cylinder();
gp_Cylinder aCylinder=aBAS->Cylinder();
aR=aCylinder.Radius();
aTol=MaxToleranceEdge(aF);
dFi=aTol/aR;
@@ -333,10 +333,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
// dv
dv = 0.;
if (aBAS.IsVPeriodic()) {
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr;
//
aVPeriod = aBAS.VPeriod();
aVPeriod = aBAS->VPeriod();
mincond = (VMin - v2 > aDelta);
maxcond = (v2 - VMax > aDelta);
//
@@ -361,8 +361,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real u,v;
u = u2 + du;
v = v2 + dv;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
if ((UMax - UMin - 2*aDelta) > aUPeriod) {
if ((u > (UMin + aDelta + aUPeriod)) ||
(u < (UMax - aDelta - aUPeriod))) {
@@ -377,8 +377,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
}
//
u = u2 + du;
if (aBAS.IsVPeriodic()) {
Standard_Real aVPeriod = aBAS.VPeriod();
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod = aBAS->VPeriod();
if ((VMax - VMin - 2*aDelta) > aVPeriod) {
if ((v > (VMin + aDelta + aVPeriod)) ||
(v < (VMax - aDelta - aVPeriod))) {
@@ -521,14 +521,14 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
Standard_Real& TolReached2d,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(aF);
pBAS = theContext->SurfaceAdaptor(aF);
}
else {
aBASTmp.Initialize(aF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(aF, Standard_True);
pBAS = aBASTmp;
}
//
Handle(BRepAdaptor_Surface) aBAHS = new BRepAdaptor_Surface(*pBAS);
@@ -622,7 +622,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
// Adjust curve for periodic surface
Handle(Geom2d_Curve) aC2DA;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (pBAS, aT1, aT2, aC2D, aC2DA);
aC2D = aC2DA;
// Make sure that the range of the 2D curve is sufficient for representation of the 3D curve.
@@ -639,7 +639,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
}
// compute the appropriate tolerance for the edge
Handle(Geom_Surface) aS = pBAS->Surface().Surface();
Handle(Geom_Surface) aS = pBAS->Surface()->Surface();
aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf()));
//
Standard_Real aT;

View File

@@ -129,7 +129,7 @@ public:
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
Standard_EXPORT static void AdjustPCurveOnSurf(const BRepAdaptor_Surface& aF,
Standard_EXPORT static void AdjustPCurveOnSurf(const Handle(BRepAdaptor_Surface)& aF,
const Standard_Real aT1,
const Standard_Real aT2,
const Handle(Geom2d_Curve)& aC2D,

View File

@@ -961,7 +961,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
//
Geom2dHatch_Hatcher& aHatcher = theContext->Hatcher(theF);
//
Geom2dAdaptor_Curve aHCur(theL2D);
Handle(Geom2dAdaptor_Curve) aHCur = new Geom2dAdaptor_Curve(theL2D);
//
aHatcher.ClrHatchings();
aIH = aHatcher.AddHatching(aHCur);

View File

@@ -488,7 +488,7 @@ static Standard_Real MapEdgeLength(const TopoDS_Edge& theEdge,
Standard_Real aLen = 0.;
if (!BRep_Tool::Degenerated(theEdge))
{
BRepAdaptor_Curve aCurve(theEdge);
Handle(BRepAdaptor_Curve) aCurve = new BRepAdaptor_Curve(theEdge);
aLen = GCPnts_AbscissaPoint::Length(aCurve);
}
pLen = theMapEdgeLen.Bound(theEdge, aLen);
@@ -505,7 +505,7 @@ namespace {
const TopoDS_Edge* Edge; // Edge
Standard_Real VParameter; // Parameter of the vertex on the edge
Standard_Boolean IsClosed; // Closed flag of the edge
Geom2dAdaptor_Curve GAdaptor; // 2D adaptor for PCurve of the edge on the face
Handle(Geom2dAdaptor_Curve) GAdaptor; // 2D adaptor for PCurve of the edge on the face
Standard_Real First; // First parameter in the range
Standard_Real Last; // Last parameter in the rage
};
@@ -532,10 +532,10 @@ static
Standard_Real aMaxDist = 0.;
Standard_Real aTol2d = 1.e-10;
//
IntRes2d_Domain aDom1(theEData1.GAdaptor.Value(aT11), aT11, aTol2d,
theEData1.GAdaptor.Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor.Value(aT21), aT21, aTol2d,
theEData2.GAdaptor.Value(aT22), aT22, aTol2d);
IntRes2d_Domain aDom1(theEData1.GAdaptor->Value(aT11), aT11, aTol2d,
theEData1.GAdaptor->Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor->Value(aT21), aT21, aTol2d,
theEData2.GAdaptor->Value(aT22), aT22, aTol2d);
//
anInter.Perform(theEData1.GAdaptor, aDom1, theEData2.GAdaptor, aDom2, aTol2d, aTol2d);
if (!anInter.IsDone() || (!anInter.NbSegments() && !anInter.NbPoints())) {
@@ -658,7 +658,7 @@ void CorrectWires(const TopoDS_Face& aFx,
if (aD2>aD2max) {
aD2max=aD2;
}
EdgeData anEData = {&aE, aT, isClosed, Geom2dAdaptor_Curve(aC2D), aT1, aT2};
EdgeData anEData = {&aE, aT, isClosed, new Geom2dAdaptor_Curve(aC2D), aT1, aT2};
aLEPars.Append(anEData);
}
//
@@ -894,7 +894,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

View File

@@ -398,7 +398,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnPlane(const TopoDS_Edge& E,
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(GP);
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve Proj(HS, HC);
Handle(ProjLib_ProjectedCurve) Proj = new ProjLib_ProjectedCurve(HS, HC);
Handle(Geom2d_Curve) pc = Geom2dAdaptor::MakeCurve(Proj);
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {

View File

@@ -20,7 +20,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<BRepAdaptor_Curve> BRepAdaptor_Array1OfCurve;
typedef NCollection_Array1<Handle(BRepAdaptor_Curve)> BRepAdaptor_Array1OfCurve;
#endif

View File

@@ -90,8 +90,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
aCopy->myCurves = new (BRepAdaptor_HArray1OfCurve) (1, myCurves->Size());
for (Standard_Integer anI = 1; anI <= myCurves->Size(); ++anI)
{
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI).ShallowCopy();
const BRepAdaptor_Curve& aBrepCurve = *(Handle(BRepAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI)->ShallowCopy();
const Handle(BRepAdaptor_Curve) aBrepCurve = Handle(BRepAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurves->SetValue(anI, aBrepCurve);
}
aCopy->myKnots = myKnots;
@@ -129,7 +129,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
E = wexp.Current();
if (! BRep_Tool::Degenerated(E)) {
ii++;
myCurves->ChangeValue(ii).Initialize(E);
myCurves->ChangeValue(ii) = new BRepAdaptor_Curve(E);
if (AC) {
myKnots->SetValue(ii+1, myKnots->Value(ii));
myKnots->ChangeValue(ii+1) +=
@@ -141,12 +141,12 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
Forward = Standard_True; // Default ; The Reverse Edges are parsed.
if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
TopAbs_Orientation Or = myCurves->Value(1)->Edge().Orientation();
TopoDS_Vertex VI, VL;
TopExp::CommonVertex(myCurves->Value(1).Edge(),
myCurves->Value(2).Edge(),
TopExp::CommonVertex(myCurves->Value(1)->Edge(),
myCurves->Value(2)->Edge(),
VI);
VL = TopExp::LastVertex(myCurves->Value(1).Edge());
VL = TopExp::LastVertex(myCurves->Value(1)->Edge());
if (VI.IsSame(VL)) { // The direction of parsing is always preserved
if (Or == TopAbs_REVERSED)
Forward = Standard_False;
@@ -182,29 +182,29 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
CurIndex = (i1+i2)/2; // Small optimization
if (i1==i2) {
if (l > f)
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(f, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(f, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(l, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(l, f, PTol));
myCurves->SetValue(i1, HC);
}
else {
const BRepAdaptor_Curve& c1 = myCurves->Value(i1);
const BRepAdaptor_Curve& c2 = myCurves->Value(i2);
const Handle(BRepAdaptor_Curve)& c1 = myCurves->Value(i1);
const Handle(BRepAdaptor_Curve)& c2 = myCurves->Value(i2);
Standard_Real k;
k = c1.LastParameter();
k = c1->LastParameter();
if (k>f)
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(f, k, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(f, k, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(k, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(k, f, PTol));
myCurves->SetValue(i1, HC);
k = c2.FirstParameter();
k = c2->FirstParameter();
if (k<=l)
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(k, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(k, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(l, k, PTol));
myCurves->SetValue(i2, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(l, k, PTol));
myCurves->SetValue(i2, HC);
}
}
@@ -221,7 +221,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
UonE = U;
Prepare(UonE, d, index);
E = myCurves->Value(index).Edge();
E = myCurves->Value(index)->Edge();
}
Standard_Real BRepAdaptor_CompCurve::FirstParameter() const
@@ -237,14 +237,14 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
GeomAbs_Shape BRepAdaptor_CompCurve::Continuity() const
{
if ( myCurves->Length() > 1) return GeomAbs_C0;
return myCurves->Value(1).Continuity();
return myCurves->Value(1)->Continuity();
}
Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S) const
{
Standard_Integer NbInt, ii;
for (ii=1, NbInt=0; ii<=myCurves->Length(); ii++)
NbInt += myCurves->ChangeValue(ii).NbIntervals(S);
NbInt += myCurves->ChangeValue(ii)->NbIntervals(S);
return NbInt;
}
@@ -256,9 +256,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real f, F, delta;
// First curve (direction of parsing of the edge)
n = myCurves->ChangeValue(1).NbIntervals(S);
n = myCurves->ChangeValue(1)->NbIntervals(S);
Handle(TColStd_HArray1OfReal) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(1).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(1)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(1, f, delta);
F = myKnots->Value(1);
if (delta < 0) {
@@ -273,9 +273,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
// and the next
for (ii=2; ii<=myCurves->Length(); ii++) {
n = myCurves->ChangeValue(ii).NbIntervals(S);
n = myCurves->ChangeValue(ii)->NbIntervals(S);
if (n != Ti->Length()-1) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(ii).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(ii)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(ii, f, delta);
F = myKnots->Value(ii);
if (delta < 0) {
@@ -321,7 +321,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return myCurves->Value(index).Value(u);
return myCurves->Value(index)->Value(u);
}
void BRepAdaptor_CompCurve::D0(const Standard_Real U,
@@ -330,7 +330,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D0(u, P);
myCurves->Value(index)->D0(u, P);
}
void BRepAdaptor_CompCurve::D1(const Standard_Real U,
@@ -340,7 +340,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D1(u, P, V);
myCurves->Value(index)->D1(u, P, V);
V*=d;
}
@@ -352,7 +352,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D2(u, P, V1, V2);
myCurves->Value(index)->D2(u, P, V1, V2);
V1*=d;
V2 *= d*d;
}
@@ -365,7 +365,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D3(u, P, V1, V2, V3);
myCurves->Value(index)->D3(u, P, V1, V2, V3);
V1*=d;
V2 *= d*d;
V3 *= d*d*d;
@@ -378,7 +378,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return (myCurves->Value(index).DN(u, N) * Pow(d, N));
return (myCurves->Value(index)->DN(u, N) * Pow(d, N));
}
Standard_Real BRepAdaptor_CompCurve::Resolution(const Standard_Real R3d) const
@@ -386,7 +386,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real Res = 1.e200, r;
Standard_Integer ii, L = myCurves->Length();
for (ii=1; ii<=L; ii++) {
r = myCurves->Value(ii).Resolution(R3d);
r = myCurves->Value(ii)->Resolution(R3d);
if (r < Res) Res = r;
}
return Res;
@@ -401,57 +401,57 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
gp_Lin BRepAdaptor_CompCurve::Line() const
{
return myCurves->Value(1).Line();
return myCurves->Value(1)->Line();
}
gp_Circ BRepAdaptor_CompCurve::Circle() const
{
return myCurves->Value(1).Circle();
return myCurves->Value(1)->Circle();
}
gp_Elips BRepAdaptor_CompCurve::Ellipse() const
{
return myCurves->Value(1).Ellipse();
return myCurves->Value(1)->Ellipse();
}
gp_Hypr BRepAdaptor_CompCurve::Hyperbola() const
{
return myCurves->Value(1).Hyperbola();
return myCurves->Value(1)->Hyperbola();
}
gp_Parab BRepAdaptor_CompCurve::Parabola() const
{
return myCurves->Value(1).Parabola();
return myCurves->Value(1)->Parabola();
}
Standard_Integer BRepAdaptor_CompCurve::Degree() const
{
return myCurves->Value(1).Degree();
return myCurves->Value(1)->Degree();
}
Standard_Boolean BRepAdaptor_CompCurve::IsRational() const
{
return myCurves->Value(1).IsRational();
return myCurves->Value(1)->IsRational();
}
Standard_Integer BRepAdaptor_CompCurve::NbPoles() const
{
return myCurves->Value(1).NbPoles();
return myCurves->Value(1)->NbPoles();
}
Standard_Integer BRepAdaptor_CompCurve::NbKnots() const
{
return myCurves->Value(1).NbKnots();
return myCurves->Value(1)->NbKnots();
}
Handle(Geom_BezierCurve) BRepAdaptor_CompCurve::Bezier() const
{
return myCurves->Value(1).Bezier();
return myCurves->Value(1)->Bezier();
}
Handle(Geom_BSplineCurve) BRepAdaptor_CompCurve::BSpline() const
{
return myCurves->Value(1).BSpline();
return myCurves->Value(1)->BSpline();
}
//=======================================================================
@@ -496,7 +496,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
}
// Invert ?
const TopoDS_Edge& E = myCurves->Value(theCurIndex).Edge();
const TopoDS_Edge& E = myCurves->Value(theCurIndex)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||
@@ -521,7 +521,7 @@ void BRepAdaptor_CompCurve::InvPrepare(const Standard_Integer index,
Standard_Real& Delta) const
{
// Invert?
const TopoDS_Edge& E = myCurves->Value(index).Edge();
const TopoDS_Edge& E = myCurves->Value(index)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||

View File

@@ -80,8 +80,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
aCopy->myTrsf = myTrsf;
const Handle(Adaptor3d_Curve) aCurve = myCurve.ShallowCopy();
const GeomAdaptor_Curve& aGeomCurve = *(Handle(GeomAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurve->ShallowCopy();
const Handle(GeomAdaptor_Curve) aGeomCurve = Handle(GeomAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurve = aGeomCurve;
if (!myConSurf.IsNull())
@@ -99,7 +99,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
//=======================================================================
void BRepAdaptor_Curve::Reset()
{
myCurve.Reset();
myCurve->Reset();
myConSurf.Nullify();
myEdge.Nullify();
myTrsf = gp_Trsf();
@@ -120,7 +120,8 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,pf,pl);
if (!C.IsNull()) {
myCurve.Load(C,pf,pl);
myCurve = new GeomAdaptor_Curve();
myCurve->Load(C,pf,pl);
}
else {
Handle(Geom2d_Curve) PC;
@@ -147,7 +148,7 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
//=======================================================================
void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E,
const TopoDS_Face& F)
const TopoDS_Face& F)
{
myConSurf.Nullify();
@@ -202,7 +203,7 @@ Standard_Boolean BRepAdaptor_Curve::IsCurveOnSurface() const
//purpose :
//=======================================================================
const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
const Handle(GeomAdaptor_Curve)& BRepAdaptor_Curve::Curve() const
{
return myCurve;
}
@@ -212,9 +213,9 @@ const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
//purpose :
//=======================================================================
const Adaptor3d_CurveOnSurface& BRepAdaptor_Curve::CurveOnSurface() const
const Handle(Adaptor3d_CurveOnSurface)& BRepAdaptor_Curve::CurveOnSurface() const
{
return *myConSurf;
return myConSurf;
}
//=======================================================================
@@ -245,7 +246,7 @@ Standard_Real BRepAdaptor_Curve::Tolerance() const
Standard_Real BRepAdaptor_Curve::FirstParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.FirstParameter();
return myCurve->FirstParameter();
}
else {
return myConSurf->FirstParameter();
@@ -257,10 +258,10 @@ Standard_Real BRepAdaptor_Curve::FirstParameter() const
//purpose :
//=======================================================================
Standard_Real BRepAdaptor_Curve::LastParameter() const
Standard_Real BRepAdaptor_Curve::LastParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.LastParameter();
return myCurve->LastParameter();
}
else {
return myConSurf->LastParameter();
@@ -275,7 +276,7 @@ Standard_Real BRepAdaptor_Curve::LastParameter() const
GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
{
if (myConSurf.IsNull()) {
return myCurve.Continuity();
return myCurve->Continuity();
}
else {
return myConSurf->Continuity();
@@ -290,7 +291,7 @@ GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
Standard_Integer BRepAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
return myCurve.NbIntervals(S);
return myCurve->NbIntervals(S);
}
else {
return myConSurf->NbIntervals(S);
@@ -306,7 +307,7 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
myCurve.Intervals(T, S);
myCurve->Intervals(T, S);
}
else {
myConSurf->Intervals(T, S);
@@ -320,17 +321,16 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
//=======================================================================
Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol) const
const Standard_Real Last,
const Standard_Real Tol) const
{
// On fait une copie de this pour garder la trsf.
Handle(BRepAdaptor_Curve) res;
if (myConSurf.IsNull()){
Standard_Real pf = FirstParameter(), pl = LastParameter();
Handle(Geom_Curve) C = myCurve.Curve();
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,First,Last);
res = new BRepAdaptor_Curve (*this);
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,pf,pl);
Handle(GeomAdaptor_Curve) aGAC = myCurve;
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = Handle(GeomAdaptor_Curve)::DownCast(myCurve->Trim(First, Last, Tol));
res = new BRepAdaptor_Curve(*this);
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = aGAC;
}
else {
Handle(Adaptor3d_CurveOnSurface) sav = myConSurf;
@@ -350,7 +350,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
Standard_Boolean BRepAdaptor_Curve::IsClosed() const
{
if (myConSurf.IsNull()) {
return myCurve.IsClosed();
return myCurve->IsClosed();
}
else {
return myConSurf->IsClosed();
@@ -365,7 +365,7 @@ Standard_Boolean BRepAdaptor_Curve::IsClosed() const
Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
{
if (myConSurf.IsNull()) {
return myCurve.IsPeriodic();
return myCurve->IsPeriodic();
}
else {
return myConSurf->IsPeriodic();
@@ -380,7 +380,7 @@ Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
Standard_Real BRepAdaptor_Curve::Period() const
{
if (myConSurf.IsNull()) {
return myCurve.Period();
return myCurve->Period();
}
else {
return myConSurf->Period();
@@ -396,7 +396,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
{
gp_Pnt P;
if (myConSurf.IsNull())
P = myCurve.Value(U);
P = myCurve->Value(U);
else
P = myConSurf->Value(U);
P.Transform(myTrsf);
@@ -411,7 +411,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
{
if (myConSurf.IsNull())
myCurve.D0(U,P);
myCurve->D0(U,P);
else
myConSurf->D0(U,P);
P.Transform(myTrsf);
@@ -423,10 +423,10 @@ void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
//=======================================================================
void BRepAdaptor_Curve::D1(const Standard_Real U,
gp_Pnt& P, gp_Vec& V) const
gp_Pnt& P, gp_Vec& V) const
{
if (myConSurf.IsNull())
myCurve.D1(U,P,V);
myCurve->D1(U,P,V);
else
myConSurf->D1(U,P,V);
P.Transform(myTrsf);
@@ -439,10 +439,10 @@ void BRepAdaptor_Curve::D1(const Standard_Real U,
//=======================================================================
void BRepAdaptor_Curve::D2(const Standard_Real U,
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
{
if (myConSurf.IsNull())
myCurve.D2(U,P,V1,V2);
myCurve->D2(U,P,V1,V2);
else
myConSurf->D2(U,P,V1,V2);
P.Transform(myTrsf);
@@ -456,11 +456,11 @@ void BRepAdaptor_Curve::D2(const Standard_Real U,
//=======================================================================
void BRepAdaptor_Curve::D3(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
gp_Pnt& P,
gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
{
if (myConSurf.IsNull())
myCurve.D3(U,P,V1,V2,V3);
myCurve->D3(U,P,V1,V2,V3);
else
myConSurf->D3(U,P,V1,V2,V3);
P.Transform(myTrsf);
@@ -474,12 +474,12 @@ void BRepAdaptor_Curve::D3(const Standard_Real U,
//purpose :
//=======================================================================
gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
const Standard_Integer N) const
gp_Vec BRepAdaptor_Curve::DN (const Standard_Real U,
const Standard_Integer N) const
{
gp_Vec V;
if (myConSurf.IsNull())
V = myCurve.DN(U,N);
V = myCurve->DN(U,N);
else
V = myConSurf->DN(U,N);
V.Transform(myTrsf);
@@ -494,7 +494,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
{
if (myConSurf.IsNull()) {
return myCurve.Resolution(R);
return myCurve->Resolution(R);
}
else {
return myConSurf->Resolution(R);
@@ -509,7 +509,7 @@ Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
GeomAbs_CurveType BRepAdaptor_Curve::GetType() const
{
if (myConSurf.IsNull()) {
return myCurve.GetType();
return myCurve->GetType();
}
else {
return myConSurf->GetType();
@@ -525,7 +525,7 @@ gp_Lin BRepAdaptor_Curve::Line() const
{
gp_Lin L;
if (myConSurf.IsNull())
L = myCurve.Line();
L = myCurve->Line();
else
L = myConSurf->Line();
L.Transform(myTrsf);
@@ -541,7 +541,7 @@ gp_Circ BRepAdaptor_Curve::Circle() const
{
gp_Circ C;
if (myConSurf.IsNull())
C = myCurve.Circle();
C = myCurve->Circle();
else
C = myConSurf->Circle();
C.Transform(myTrsf);
@@ -557,7 +557,7 @@ gp_Elips BRepAdaptor_Curve::Ellipse() const
{
gp_Elips E;
if (myConSurf.IsNull())
E = myCurve.Ellipse();
E = myCurve->Ellipse();
else
E = myConSurf->Ellipse();
E.Transform(myTrsf);
@@ -573,7 +573,7 @@ gp_Hypr BRepAdaptor_Curve::Hyperbola() const
{
gp_Hypr H;
if (myConSurf.IsNull())
H = myCurve.Hyperbola();
H = myCurve->Hyperbola();
else
H = myConSurf->Hyperbola();
H.Transform(myTrsf);
@@ -589,7 +589,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
{
gp_Parab P;
if (myConSurf.IsNull())
P = myCurve.Parabola();
P = myCurve->Parabola();
else
P = myConSurf->Parabola();
P.Transform(myTrsf);
@@ -604,7 +604,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
Standard_Integer BRepAdaptor_Curve::Degree() const
{
if (myConSurf.IsNull())
return myCurve.Degree();
return myCurve->Degree();
else
return myConSurf->Degree();
}
@@ -617,7 +617,7 @@ Standard_Integer BRepAdaptor_Curve::Degree() const
Standard_Boolean BRepAdaptor_Curve::IsRational() const
{
if (myConSurf.IsNull())
return myCurve.IsRational();
return myCurve->IsRational();
else
return myConSurf->IsRational();
}
@@ -629,7 +629,7 @@ Standard_Boolean BRepAdaptor_Curve::IsRational() const
Standard_Integer BRepAdaptor_Curve::NbPoles() const
{
if (myConSurf.IsNull())
return myCurve.NbPoles();
return myCurve->NbPoles();
else
return myConSurf->NbPoles();
}
@@ -641,7 +641,7 @@ Standard_Integer BRepAdaptor_Curve::NbPoles() const
Standard_Integer BRepAdaptor_Curve::NbKnots() const
{
if (myConSurf.IsNull())
return myCurve.NbKnots();
return myCurve->NbKnots();
else
return myConSurf->NbKnots();
}
@@ -655,7 +655,7 @@ Handle(Geom_BezierCurve) BRepAdaptor_Curve::Bezier() const
{
Handle(Geom_BezierCurve) BC;
if (myConSurf.IsNull()) {
BC = myCurve.Bezier();
BC = myCurve->Bezier();
}
else {
BC = myConSurf->Bezier();
@@ -674,7 +674,7 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
{
Handle(Geom_BSplineCurve) BS;
if (myConSurf.IsNull()) {
BS = myCurve.BSpline();
BS = myCurve->BSpline();
}
else {
BS = myConSurf->BSpline();
@@ -690,10 +690,10 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
{
if ( !Is3DCurve() || myCurve.GetType() != GeomAbs_OffsetCurve)
if ( !Is3DCurve() || myCurve->GetType() != GeomAbs_OffsetCurve)
throw Standard_NoSuchObject("BRepAdaptor_Curve::OffsetCurve");
Handle(Geom_OffsetCurve) anOffC = myCurve.OffsetCurve();
Handle(Geom_OffsetCurve) anOffC = myCurve->OffsetCurve();
return myTrsf.Form() == gp_Identity
? anOffC : Handle(Geom_OffsetCurve)::DownCast(anOffC->Transformed(myTrsf));
}

View File

@@ -103,10 +103,10 @@ public:
Standard_EXPORT Standard_Boolean IsCurveOnSurface() const;
//! Returns the Curve of the edge.
Standard_EXPORT const GeomAdaptor_Curve& Curve() const;
Standard_EXPORT const Handle(GeomAdaptor_Curve)& Curve() const;
//! Returns the CurveOnSurface of the edge.
Standard_EXPORT const Adaptor3d_CurveOnSurface& CurveOnSurface() const;
Standard_EXPORT const Handle(Adaptor3d_CurveOnSurface)& CurveOnSurface() const;
//! Returns the edge.
Standard_EXPORT const TopoDS_Edge& Edge() const;
@@ -217,7 +217,7 @@ public:
private:
gp_Trsf myTrsf;
GeomAdaptor_Curve myCurve;
Handle(GeomAdaptor_Curve) myCurve;
Handle(Adaptor3d_CurveOnSurface) myConSurf;
TopoDS_Edge myEdge;

View File

@@ -45,6 +45,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepAdaptor_Surface, Adaptor3d_Surface)
//=======================================================================
BRepAdaptor_Surface::BRepAdaptor_Surface()
{
mySurf = new GeomAdaptor_Surface();
}
@@ -56,6 +57,7 @@ BRepAdaptor_Surface::BRepAdaptor_Surface()
BRepAdaptor_Surface::BRepAdaptor_Surface(const TopoDS_Face& F,
const Standard_Boolean R)
{
mySurf = new GeomAdaptor_Surface();
Initialize(F,R);
}
@@ -69,9 +71,8 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::ShallowCopy() const
{
Handle(BRepAdaptor_Surface) aCopy = new BRepAdaptor_Surface();
const Handle(Adaptor3d_Surface) aSurface = mySurf.ShallowCopy();
const GeomAdaptor_Surface& aGeomSurface = *(Handle(GeomAdaptor_Surface)::DownCast(aSurface));
aCopy->mySurf = aGeomSurface;
const Handle(Adaptor3d_Surface) aSurface = mySurf->ShallowCopy();
aCopy->mySurf = Handle(GeomAdaptor_Surface)::DownCast(aSurface);
aCopy->myTrsf = myTrsf;
aCopy->myFace = myFace;
@@ -95,10 +96,10 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
if (Restriction) {
Standard_Real umin,umax,vmin,vmax;
BRepTools::UVBounds(F,umin,umax,vmin,vmax);
mySurf.Load(aSurface,umin,umax,vmin,vmax);
mySurf->Load(aSurface,umin,umax,vmin,vmax);
}
else
mySurf.Load(aSurface);
mySurf->Load(aSurface);
myTrsf = L.Transformation();
}
@@ -108,23 +109,11 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
//purpose :
//=======================================================================
const GeomAdaptor_Surface& BRepAdaptor_Surface::Surface() const
const Handle(GeomAdaptor_Surface)& BRepAdaptor_Surface::Surface() const
{
return mySurf;
}
//=======================================================================
//function : ChangeSurface
//purpose :
//=======================================================================
GeomAdaptor_Surface& BRepAdaptor_Surface::ChangeSurface()
{
return mySurf;
}
//=======================================================================
//function : Trsf
//purpose :
@@ -165,7 +154,7 @@ Standard_Real BRepAdaptor_Surface::Tolerance() const
void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.UIntervals(T,S);
mySurf->UIntervals(T,S);
}
@@ -177,7 +166,7 @@ void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
void BRepAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.VIntervals(T,S);
mySurf->VIntervals(T,S);
}
@@ -192,7 +181,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::UTrim
const Standard_Real Tol ) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->UTrim(First,Last,Tol);
}
@@ -208,7 +197,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
const Standard_Real Tol) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->VTrim(First,Last,Tol);
}
@@ -221,7 +210,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
gp_Pnt BRepAdaptor_Surface::Value(const Standard_Real U,
const Standard_Real V) const
{
return mySurf.Value(U,V).Transformed(myTrsf);
return mySurf->Value(U,V).Transformed(myTrsf);
}
//=======================================================================
@@ -233,7 +222,7 @@ void BRepAdaptor_Surface::D0(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P) const
{
mySurf.D0(U,V,P);
mySurf->D0(U,V,P);
P.Transform(myTrsf);
}
@@ -248,7 +237,7 @@ void BRepAdaptor_Surface::D1(const Standard_Real U,
gp_Vec& D1U,
gp_Vec& D1V)const
{
mySurf.D1(U,V,P,D1U,D1V);
mySurf->D1(U,V,P,D1U,D1V);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -268,7 +257,7 @@ void BRepAdaptor_Surface::D2(const Standard_Real U,
gp_Vec& D2V,
gp_Vec& D2UV)const
{
mySurf.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
mySurf->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -291,7 +280,7 @@ void BRepAdaptor_Surface::D3(const Standard_Real U,
gp_Vec& D3U, gp_Vec& D3V,
gp_Vec& D3UUV, gp_Vec& D3UVV)const
{
mySurf.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
mySurf->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -315,7 +304,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{
return mySurf.DN(U,V,Nu,Nv).Transformed(myTrsf);
return mySurf->DN(U,V,Nu,Nv).Transformed(myTrsf);
}
//=======================================================================
@@ -325,7 +314,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
gp_Pln BRepAdaptor_Surface::Plane()const
{
return mySurf.Plane().Transformed(myTrsf);
return mySurf->Plane().Transformed(myTrsf);
}
@@ -336,7 +325,7 @@ gp_Pln BRepAdaptor_Surface::Plane()const
gp_Cylinder BRepAdaptor_Surface::Cylinder()const
{
return mySurf.Cylinder().Transformed(myTrsf);
return mySurf->Cylinder().Transformed(myTrsf);
}
@@ -347,7 +336,7 @@ gp_Cylinder BRepAdaptor_Surface::Cylinder()const
gp_Sphere BRepAdaptor_Surface::Sphere()const
{
return mySurf.Sphere().Transformed(myTrsf);
return mySurf->Sphere().Transformed(myTrsf);
}
@@ -358,7 +347,7 @@ gp_Sphere BRepAdaptor_Surface::Sphere()const
gp_Cone BRepAdaptor_Surface::Cone()const
{
return mySurf.Cone().Transformed(myTrsf);
return mySurf->Cone().Transformed(myTrsf);
}
//=======================================================================
@@ -368,7 +357,7 @@ gp_Cone BRepAdaptor_Surface::Cone()const
gp_Torus BRepAdaptor_Surface::Torus()const
{
return mySurf.Torus().Transformed(myTrsf);
return mySurf->Torus().Transformed(myTrsf);
}
//=======================================================================
@@ -379,7 +368,7 @@ gp_Torus BRepAdaptor_Surface::Torus()const
Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
{
return Handle(Geom_BezierSurface)::DownCast
(mySurf.Bezier()->Transformed(myTrsf));
(mySurf->Bezier()->Transformed(myTrsf));
}
@@ -391,7 +380,7 @@ Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
{
return Handle(Geom_BSplineSurface)::DownCast
(mySurf.BSpline()->Transformed(myTrsf));
(mySurf->BSpline()->Transformed(myTrsf));
}
@@ -402,7 +391,7 @@ Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
{
return mySurf.AxeOfRevolution().Transformed(myTrsf);
return mySurf->AxeOfRevolution().Transformed(myTrsf);
}
@@ -413,7 +402,7 @@ gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
gp_Dir BRepAdaptor_Surface::Direction() const
{
return mySurf.Direction().Transformed(myTrsf);
return mySurf->Direction().Transformed(myTrsf);
}
@@ -425,7 +414,7 @@ gp_Dir BRepAdaptor_Surface::Direction() const
Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisCurve();
}
@@ -439,7 +428,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisSurface();
}
@@ -451,6 +440,6 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
Standard_Real BRepAdaptor_Surface::OffsetValue() const
{
return mySurf.OffsetValue();
return mySurf->OffsetValue();
}

View File

@@ -71,10 +71,7 @@ public:
Standard_EXPORT void Initialize (const TopoDS_Face& F, const Standard_Boolean Restriction = Standard_True);
//! Returns the surface.
Standard_EXPORT const GeomAdaptor_Surface& Surface() const;
//! Returns the surface.
Standard_EXPORT GeomAdaptor_Surface& ChangeSurface();
Standard_EXPORT const Handle(GeomAdaptor_Surface)& Surface() const;
//! Returns the surface coordinate system.
Standard_EXPORT const gp_Trsf& Trsf() const;
@@ -85,27 +82,27 @@ public:
//! Returns the face tolerance.
Standard_EXPORT Standard_Real Tolerance() const;
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf.FirstUParameter(); }
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf->FirstUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf.LastUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf->LastUParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf.FirstVParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf->FirstVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf.LastVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf->LastVParameter(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf.UContinuity(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf->UContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf.VContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf->VContinuity(); }
//! If necessary, breaks the surface in U intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbUIntervals (theSh); }
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbUIntervals (theSh); }
//! If necessary, breaks the surface in V intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbVIntervals (theSh); }
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbVIntervals (theSh); }
//! Returns the intervals with the requested continuity
//! in the U direction.
@@ -128,17 +125,17 @@ public:
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor3d_Surface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf.IsUClosed(); }
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf->IsUClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf.IsVClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf->IsVClosed(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf.IsUPeriodic(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf->IsUPeriodic(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf.UPeriod(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf->UPeriod(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf.IsVPeriodic(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf->IsVPeriodic(); }
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf.VPeriod(); }
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.
@@ -174,17 +171,17 @@ public:
//! Returns the parametric U resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.UResolution (theR3d); }
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->UResolution (theR3d); }
//! Returns the parametric V resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.VResolution (theR3d); }
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->VResolution (theR3d); }
//! Returns the type of the surface : Plane, Cylinder,
//! Cone, Sphere, Torus, BezierSurface,
//! BSplineSurface, SurfaceOfRevolution,
//! SurfaceOfExtrusion, OtherSurface
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf.GetType(); }
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf->GetType(); }
Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
@@ -196,21 +193,21 @@ public:
Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf.UDegree(); }
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf->UDegree(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf.NbUPoles(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf->NbUPoles(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf.VDegree(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf->VDegree(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf.NbVPoles(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf->NbVPoles(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf.NbUKnots(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf->NbUKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf.NbVKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf->NbVKnots(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf.IsURational(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf->IsURational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf.IsVRational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf->IsVRational(); }
Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
@@ -236,7 +233,7 @@ public:
private:
GeomAdaptor_Surface mySurf;
Handle(GeomAdaptor_Surface) mySurf;
gp_Trsf myTrsf;
TopoDS_Face myFace;

View File

@@ -244,7 +244,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
for(i = 1; i <= NbEdges; i++){
DescenList.Clear();
Handle(BRepAdaptor_Curve) hcur = new BRepAdaptor_Curve (TopoDS::Edge(Edges->Value(i)));
Elementary = IsElementary(*hcur);
Elementary = IsElementary(hcur);
for(j = 1; j <= NbFaces; j++){
Handle(BRepAdaptor_Surface) hsur = new BRepAdaptor_Surface (TopoDS::Face(Faces->Value(j)));
@@ -627,10 +627,10 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
//purpose :
//=======================================================================
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Adaptor3d_Curve& C) const
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Handle(Adaptor3d_Curve)& C) const
{
GeomAbs_CurveType type;
type = C.GetType();
type = C->GetType();
switch(type) {
case GeomAbs_Line:
case GeomAbs_Circle:

View File

@@ -92,7 +92,7 @@ public:
//! shape <S>.
Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
Standard_EXPORT Standard_Boolean IsElementary (const Adaptor3d_Curve& C) const;
Standard_EXPORT Standard_Boolean IsElementary (const Handle(Adaptor3d_Curve)& C) const;
//! build the result as a list of wire if possible in --
//! a first returns a wire only if there is only a wire.

View File

@@ -79,7 +79,7 @@ public:
Standard_EXPORT BRepApprox_Approx();
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
@@ -120,7 +120,7 @@ protected:
private:
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void UpdateTolReached();

View File

@@ -37,7 +37,7 @@
#include <AppParCurves_MultiBSpCurve.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -19,24 +19,24 @@
#include <BRepAdaptor_Surface.hxx>
#include <Geom_BezierSurface.hxx>
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{

View File

@@ -41,85 +41,85 @@ public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastUParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastVParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbUIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void UIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) UTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) VTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
static Standard_Real UPeriod (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real VPeriod (const BRepAdaptor_Surface& S);
static Standard_Real VPeriod (const Handle(BRepAdaptor_Surface)& S);
static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static gp_Pnt Value (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v);
static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D0 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D1 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D2 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D2 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D3 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static void D3 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static gp_Vec DN (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real UResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S);
static GeomAbs_SurfaceType GetType (const Handle(BRepAdaptor_Surface)& S);
static gp_Pln Plane (const BRepAdaptor_Surface& S);
static gp_Pln Plane (const Handle(BRepAdaptor_Surface)& S);
static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder (const Handle(BRepAdaptor_Surface)& S);
static gp_Cone Cone (const BRepAdaptor_Surface& S);
static gp_Cone Cone (const Handle(BRepAdaptor_Surface)& S);
static gp_Torus Torus (const BRepAdaptor_Surface& S);
static gp_Torus Torus (const Handle(BRepAdaptor_Surface)& S);
static gp_Sphere Sphere (const BRepAdaptor_Surface& S);
static gp_Sphere Sphere (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline (const Handle(BRepAdaptor_Surface)& S);
static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution (const Handle(BRepAdaptor_Surface)& S);
static gp_Dir Direction (const BRepAdaptor_Surface& S);
static gp_Dir Direction (const Handle(BRepAdaptor_Surface)& S);
static Handle(Adaptor3d_Curve) BasisCurve (const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S, const Standard_Real v1, const Standard_Real v2);

View File

@@ -28,107 +28,107 @@
#include <Adaptor3d_Surface.hxx>
#include <Adaptor3d_Curve.hxx>
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastVParameter();}
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbUIntervals(S);
return Surf->NbUIntervals(S);
}
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbVIntervals(S);
return Surf->NbVIntervals(S);
}
inline void BRepApprox_SurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::UIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.UIntervals(Tab,S);
Surf->UIntervals(Tab,S);
}
inline void BRepApprox_SurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::VIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.VIntervals(Tab,S);
Surf->VIntervals(Tab,S);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.UTrim(F,L,Tol);
return Surf->UTrim(F,L,Tol);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.VTrim(F,L,Tol);
return Surf->VTrim(F,L,Tol);
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUClosed();
return S->IsUClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVClosed();
return S->IsVClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUPeriodic();
return S->IsUPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.UPeriod();
return S->UPeriod();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVPeriodic();
return S->IsVPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.VPeriod();
return S->VPeriod();
}
inline gp_Pnt BRepApprox_SurfaceTool::Value(const BRepAdaptor_Surface& S,
inline gp_Pnt BRepApprox_SurfaceTool::Value(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V )
{
return S.Value(U,V);
return S->Value(U,V);
}
inline void BRepApprox_SurfaceTool::D0(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D0(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
S.D0(U,V,P);
S->D0(U,V,P);
}
inline void BRepApprox_SurfaceTool::D1(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D1(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
S.D1(U,V,P,D1U,D1V);
S->D1(U,V,P,D1U,D1V);
}
inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D2(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -138,10 +138,10 @@ inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
gp_Vec& D2V,
gp_Vec& D2UV)
{
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
S->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
}
inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D3(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -155,78 +155,78 @@ inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{
S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
S->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
}
inline gp_Vec BRepApprox_SurfaceTool::DN(const BRepAdaptor_Surface& S,
inline gp_Vec BRepApprox_SurfaceTool::DN(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return S.DN(U,V,Nu,Nv);
return S->DN(U,V,Nu,Nv);
}
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.UResolution(R3d);
return S->UResolution(R3d);
}
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.VResolution(R3d);
return S->VResolution(R3d);
}
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const BRepAdaptor_Surface& S )
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const Handle(BRepAdaptor_Surface)& S )
{
return S.GetType();
return S->GetType();
}
inline gp_Pln BRepApprox_SurfaceTool::Plane(const BRepAdaptor_Surface& S)
inline gp_Pln BRepApprox_SurfaceTool::Plane(const Handle(BRepAdaptor_Surface)& S)
{
return S.Plane();
return S->Plane();
}
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cylinder();
return S->Cylinder();
}
inline gp_Cone BRepApprox_SurfaceTool::Cone(const BRepAdaptor_Surface& S)
inline gp_Cone BRepApprox_SurfaceTool::Cone(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cone();
return S->Cone();
}
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const BRepAdaptor_Surface& S)
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const Handle(BRepAdaptor_Surface)& S)
{
return S.Sphere();
return S->Sphere();
}
inline gp_Torus BRepApprox_SurfaceTool::Torus(const BRepAdaptor_Surface& S)
inline gp_Torus BRepApprox_SurfaceTool::Torus(const Handle(BRepAdaptor_Surface)& S)
{
return S.Torus();
return S->Torus();
}
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const BRepAdaptor_Surface& S) {
return(S.Bezier());
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const Handle(BRepAdaptor_Surface)& S) {
return(S->Bezier());
}
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const BRepAdaptor_Surface& S) {
return(S.BSpline());
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const Handle(BRepAdaptor_Surface)& S) {
return(S->BSpline());
}
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S) {
return(S.AxeOfRevolution());
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const Handle(BRepAdaptor_Surface)& S) {
return(S->AxeOfRevolution());
}
inline gp_Dir BRepApprox_SurfaceTool::Direction(const BRepAdaptor_Surface& S) {
return(S.Direction());
inline gp_Dir BRepApprox_SurfaceTool::Direction(const Handle(BRepAdaptor_Surface)& S) {
return(S->Direction());
}
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const BRepAdaptor_Surface& S) {
return(S.BasisCurve());
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const Handle(BRepAdaptor_Surface)& S) {
return(S->BasisCurve());
}

View File

@@ -42,7 +42,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2);
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
@@ -69,9 +69,9 @@ public:
gp_Dir2d DirectionOnS2() const;
const BRepAdaptor_Surface& AuxillarSurface1() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface1() const;
const BRepAdaptor_Surface& AuxillarSurface2() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface2() const;
@@ -113,7 +113,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -23,7 +23,7 @@
#include <math_Matrix.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,9 +47,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -27,7 +27,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,7 +47,7 @@ public:
DEFINE_STANDARD_ALLOC
//! compute the solution point with the close point
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! initialize the parameters to compute the solution point
//! it 's possible to write to optimize:
@@ -59,7 +59,7 @@ public:
//! param(3)=...
//! inter.Perform(Param,rsnld);
//! }
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! returns the best constant isoparametric to find
//! the next intersection's point +stores the solution

View File

@@ -29,7 +29,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,7 +46,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -26,7 +26,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,11 +46,11 @@ public:
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox();
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& IS);
void Set (const BRepAdaptor_Surface& PS);
void Set (const Handle(BRepAdaptor_Surface)& PS);
void SetImplicitSurface (const IntSurf_Quadric& IS);
@@ -80,7 +80,7 @@ public:
const gp_Dir2d& Direction2d();
const BRepAdaptor_Surface& PSurface() const;
const Handle(BRepAdaptor_Surface) PSurface() const;
const IntSurf_Quadric& ISurface() const;
@@ -118,7 +118,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -27,7 +27,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -56,7 +56,7 @@ Standard_Boolean BRepBlend_BlendTool::Project(const gp_Pnt2d& P,
const Standard_Real epsX = 1.e-8;
const Standard_Integer Nbu = 20;
const Standard_Real Tol = 1.e-5;
Extrema_EPCOfExtPC2d extrema(P, *C, Nbu, epsX, Tol);
Extrema_EPCOfExtPC2d extrema(P, C, Nbu, epsX, Tol);
if (!extrema.IsDone())
return Standard_True;
@@ -91,9 +91,9 @@ Standard_Boolean BRepBlend_BlendTool::Inters(const gp_Pnt2d& P1,
gp_Dir2d d(v);
Handle(Geom2d_Line) bid = new Geom2d_Line(P1,d);
Geom2dAdaptor_Curve seg(bid,-0.01*mag,1.01*mag);
Handle(Geom2dAdaptor_Curve) seg = new Geom2dAdaptor_Curve(bid,-0.01*mag,1.01*mag);
Geom2dInt_GInter inter (seg, *C, Tol, Tol);
Geom2dInt_GInter inter (seg, C, Tol, Tol);
if (!inter.IsDone())
return Standard_False;

View File

@@ -45,7 +45,7 @@
#include <Extrema_ExtSS.hxx>
#include <GeomAdaptor_Surface.hxx>
//
static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS);
static Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS);
//
static void FindExactUVBounds(const TopoDS_Face F,
Standard_Real& umin, Standard_Real& umax,
@@ -53,13 +53,13 @@ static void FindExactUVBounds(const TopoDS_Face F,
const Standard_Real Tol,
Standard_Boolean& isNaturalRestriction);
//
static void AdjustFaceBox(const BRepAdaptor_Surface& BS,
static void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
const Bnd_Box& EdgeBox, const Standard_Real Tol);
//
static Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
static Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -76,10 +76,10 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
TopLoc_Location l, aDummyLoc;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -92,16 +92,16 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
} else
{
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
if (BS.GetType() != GeomAbs_Plane) {
BS.Initialize(F);
BS->Initialize(F, Standard_False);
if (BS->GetType() != GeomAbs_Plane) {
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
// on travaille directement sur les courbes 3d.
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
@@ -109,7 +109,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
const TopoDS_Edge& anEdge = TopoDS::Edge(ex2.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add (BC, BRep_Tool::Tolerance (anEdge), B);
}
}
@@ -167,7 +167,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
}
}
@@ -197,13 +197,13 @@ void BRepBndLib::AddClose(const TopoDS_Shape& S, Bnd_Box& B)
// Add the edges
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
const TopoDS_Edge& anEdge = TopoDS::Edge (ex.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add(BC,0.,B);
}
}
@@ -226,11 +226,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
Handle(Poly_Triangulation) T;
TopLoc_Location l;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -248,11 +248,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
const Handle(Geom_Surface)& GS = BRep_Tool::Surface(F, l);
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
BS->Initialize(F, Standard_False);
if (CanUseEdges(BS)) {
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(F) : 0.;
BndLib_AddSurface::AddOptimal(BS, Tol, aLocBox);
}
@@ -266,7 +266,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
aLocBox.Add(anEBox);
@@ -293,7 +293,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
EBox.Add(anEBox);
@@ -359,7 +359,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(E) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, aLocBox);
}
@@ -392,9 +392,9 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
//purpose : Define is it possible using only edges bnd boxes
// to get face bnd box
//=======================================================================
Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS)
{
GeomAbs_SurfaceType aST = BS.GetType();
GeomAbs_SurfaceType aST = BS->GetType();
if(aST == GeomAbs_Plane ||
aST == GeomAbs_Cylinder ||
aST == GeomAbs_Cone ||
@@ -404,7 +404,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_SurfaceOfRevolution)
{
const Handle(Adaptor3d_Curve)& aBC = BS.BasisCurve();
const Handle(Adaptor3d_Curve)& aBC = BS->BasisCurve();
if(aBC->GetType() == GeomAbs_Line)
{
return Standard_True;
@@ -416,12 +416,12 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_OffsetSurface)
{
const Handle(Adaptor3d_Surface)& aS = BS.BasisSurface();
return CanUseEdges (*aS);
const Handle(Adaptor3d_Surface)& aS = BS->BasisSurface();
return CanUseEdges (aS);
}
else if(aST == GeomAbs_BSplineSurface)
{
Handle(Geom_BSplineSurface) aBSpl = BS.BSpline();
Handle(Geom_BSplineSurface) aBSpl = BS->BSpline();
if((aBSpl->UDegree() == 1 && aBSpl->NbUKnots() == 2) ||
(aBSpl->VDegree() == 1 && aBSpl->NbVKnots() == 2))
{
@@ -434,7 +434,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_BezierSurface)
{
Handle(Geom_BezierSurface) aBz = BS.Bezier();
Handle(Geom_BezierSurface) aBz = BS->Bezier();
if((aBz->UDegree() == 1 ) ||
(aBz->VDegree() == 1 ))
{
@@ -637,7 +637,7 @@ inline void Reorder(Standard_Real& a, Standard_Real& b)
//function : IsModifySize
//purpose :
//=======================================================================
Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -649,7 +649,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Reorder(pu1, pu2);
Reorder(pv1, pv2);
Handle(Geom_Plane) aPlane = new Geom_Plane(thePln);
GeomAdaptor_Surface aGAPln(aPlane, pu1, pu2, pv1, pv2);
Handle(GeomAdaptor_Surface) aGAPln = new GeomAdaptor_Surface(aPlane, pu1, pu2, pv1, pv2);
Extrema_ExtSS anExtr(aGAPln, theBS, pu1, pu2, pv1, pv2, umin, umax, vmin, vmax, theTolU, theTolV);
if(anExtr.IsDone())
{
@@ -698,7 +698,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
//function : AdjustFaceBox
//purpose :
//=======================================================================
void AdjustFaceBox(const BRepAdaptor_Surface& BS,
void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
@@ -720,9 +720,9 @@ void AdjustFaceBox(const BRepAdaptor_Surface& BS,
FaceBox.Get(fxmin, fymin, fzmin, fxmax, fymax, fzmax);
EdgeBox.Get(exmin, eymin, ezmin, exmax, eymax, ezmax);
//
Standard_Real TolU = Max(BS.UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS.VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS.Face(), Max(TolU, TolV));
Standard_Real TolU = Max(BS->UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS->VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS->Face(), Max(TolU, TolV));
//
Standard_Boolean isModified = Standard_False;
if(exmin > fxmin)

View File

@@ -35,12 +35,12 @@
// Function : IsLinear
// purpose : Returns TRUE if theC is line-like.
//=======================================================================
static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
static Standard_Boolean IsLinear(const Handle(Adaptor3d_Curve)& theC)
{
const GeomAbs_CurveType aCT = theC.GetType();
const GeomAbs_CurveType aCT = theC->GetType();
if(aCT == GeomAbs_OffsetCurve)
{
return IsLinear(GeomAdaptor_Curve(theC.OffsetCurve()->BasisCurve()));
return IsLinear(new GeomAdaptor_Curve(theC->OffsetCurve()->BasisCurve()));
}
if((aCT == GeomAbs_BSplineCurve) || (aCT == GeomAbs_BezierCurve))
@@ -49,8 +49,8 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// represented with set of points. It will be possible made
// in the future.
return ((theC.Degree() == 1) &&
(theC.Continuity() != GeomAbs_C0));
return ((theC->Degree() == 1) &&
(theC->Continuity() != GeomAbs_C0));
}
if(aCT == GeomAbs_Line)
@@ -65,29 +65,29 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// Function : IsPlanar
// purpose : Returns TRUE if theS is plane-like.
//=======================================================================
static Standard_Boolean IsPlanar(const Adaptor3d_Surface& theS)
static Standard_Boolean IsPlanar(const Handle(Adaptor3d_Surface)& theS)
{
const GeomAbs_SurfaceType aST = theS.GetType();
const GeomAbs_SurfaceType aST = theS->GetType();
if(aST == GeomAbs_OffsetSurface)
{
return IsPlanar (*theS.BasisSurface());
return IsPlanar (theS->BasisSurface());
}
if(aST == GeomAbs_SurfaceOfExtrusion)
{
return IsLinear (*theS.BasisCurve());
return IsLinear (theS->BasisCurve());
}
if((aST == GeomAbs_BSplineSurface) || (aST == GeomAbs_BezierSurface))
{
if((theS.UDegree() != 1) || (theS.VDegree() != 1))
if((theS->UDegree() != 1) || (theS->VDegree() != 1))
return Standard_False;
// Indeed, surfaces with C0-continuity and degree==1, may be
// represented with set of points. It will be possible made
// in the future.
return ((theS.UContinuity() != GeomAbs_C0) && (theS.VContinuity() != GeomAbs_C0));
return ((theS->UContinuity() != GeomAbs_C0) && (theS->VContinuity() != GeomAbs_C0));
}
if(aST == GeomAbs_Plane)
@@ -157,7 +157,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (!IsLinear(anAC))
{
if (!theIsTriangulationUsed)
@@ -210,7 +210,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (IsLinear(anAC))
{
// skip linear edge as its vertices have already been added

View File

@@ -174,7 +174,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape,
Standard_Real first,last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(aedge), first, last);
if (!c3d.IsNull()) {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
TotLength += length;
if (ve2.IsSame(v1) || ve2.IsSame(v2)) break;
@@ -444,10 +444,10 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge,
return Standard_False;
Standard_Real first, last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(theEdge,first, last);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
for (Standard_Integer i = 1; i <= nbV; i++) {
@@ -574,10 +574,10 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
// Take the longest edge as first
Standard_Real f, l;
Handle(Geom_Curve) c3d1 = BRep_Tool::Curve(TopoDS::Edge(edgeFirst), f, l);
GeomAdaptor_Curve cAdapt1(c3d1);
Handle(GeomAdaptor_Curve) cAdapt1 = new GeomAdaptor_Curve(c3d1);
Standard_Real len1 = GCPnts_AbscissaPoint::Length(cAdapt1, f, l);
Handle(Geom_Curve) c3d2 = BRep_Tool::Curve(TopoDS::Edge(edgeLast), f, l);
GeomAdaptor_Curve cAdapt2(c3d2);
Handle(GeomAdaptor_Curve) cAdapt2 = new GeomAdaptor_Curve(c3d2);
Standard_Real len2 = GCPnts_AbscissaPoint::Length(cAdapt2, f, l);
if (len1 < len2) {
edge1 = edgeLast;
@@ -1017,7 +1017,7 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS
c3d->Transform(loc.Transformation());
}
GeomAdaptor_Curve adapt(c3d);
Handle(GeomAdaptor_Curve) adapt = new GeomAdaptor_Curve(c3d);
GCPnts_UniformAbscissa uniAbs(adapt, npt, first, last);
Standard_Real cumulateAngular = 0.0;
@@ -1283,7 +1283,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1,
Standard_Real C2Umin, C2Vmin, C2Umax, C2Vmax;
{ //szv: Use brackets to destroy local variables
Bnd_Box2d B1, B2;
Geom2dAdaptor_Curve aC2d1(C2d1), aC2d2(C2d2);
Handle(Geom2dAdaptor_Curve) aC2d1 = new Geom2dAdaptor_Curve(C2d1);
Handle(Geom2dAdaptor_Curve) aC2d2 = new Geom2dAdaptor_Curve(C2d2);
BndLib_Add2dCurve::Add(aC2d1,first2d1,last2d1,Precision::PConfusion(),B1);
BndLib_Add2dCurve::Add(aC2d2,first2d2,last2d2,Precision::PConfusion(),B2);
B1.Get(C1Umin,C1Vmin,C1Umax,C1Vmax);
@@ -3559,7 +3560,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
for (i = 1; i <= nbSection; i++) {
Standard_Real f, l;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(seqEdges(i)), f, l);
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real len = GCPnts_AbscissaPoint::Length(cAdapt, f, l);
if (len > lenRef) { indRef = i; lenRef = len; }
}
@@ -3646,7 +3647,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
{ //szv: Use brackets to destroy local variables
// Create bounding box around curve
Bnd_Box aGlobalBox;
GeomAdaptor_Curve adptC(c3d,first,last);
Handle(GeomAdaptor_Curve) adptC = new GeomAdaptor_Curve(c3d,first,last);
BndLib_Add3dCurve::Add(adptC,myTolerance,aGlobalBox);
// Sort vertices to find candidates
aSelector.SetCurrent (aGlobalBox);
@@ -3848,7 +3849,7 @@ static Standard_Boolean IsDegeneratedWire(const TopoDS_Shape& wire)
length = pfirst.Distance(plast);
}
else {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
}
Standard_Real tole = BRep_Tool::Tolerance(Ve1)+BRep_Tool::Tolerance(Ve2);
@@ -4288,10 +4289,10 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
{
arrDist.Init(-1.0);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
Standard_Integer find = 1;//(isConsiderEnds ? 1 : 2);
Standard_Integer lind = arrPnt.Length();//(isConsiderEnds ? arrPnt.Length() : arrPnt.Length() -1);
@@ -4316,7 +4317,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
isProjected = Standard_True;
Extrema_POnCurv pOnC = locProj.Point(indMin);
Standard_Real paramProj = pOnC.Parameter();
gp_Pnt ptProj = GAC.Value(paramProj);
gp_Pnt ptProj = GAC->Value(paramProj);
Standard_Real distProj2 = ptProj.SquareDistance(pt);
if (!locProj.IsMin(indMin)) {
if (Min(distF2,distL2) < dist2Min) {

View File

@@ -67,15 +67,15 @@ Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W,
//function : PrecCurve
//purpose :
//=======================================================================
Standard_Real BRepCheck::PrecCurve(const Adaptor3d_Curve& aAC3D)
Standard_Real BRepCheck::PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D)
{
Standard_Real aXEmax = RealEpsilon();
//
GeomAbs_CurveType aCT = aAC3D.GetType();
GeomAbs_CurveType aCT = aAC3D->GetType();
if (aCT==GeomAbs_Ellipse) {
Standard_Real aX[5];
//
gp_Elips aEL3D=aAC3D.Ellipse();
gp_Elips aEL3D=aAC3D->Ellipse();
aEL3D.Location().Coord(aX[0], aX[1], aX[2]);
aX[3]=aEL3D.MajorRadius();
aX[4]=aEL3D.MinorRadius();

View File

@@ -44,7 +44,7 @@ public:
Standard_EXPORT static Standard_Boolean SelfIntersection (const TopoDS_Wire& W, const TopoDS_Face& F, TopoDS_Edge& E1, TopoDS_Edge& E2);
//! Returns the resolution on the 3d curve
Standard_EXPORT static Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D);
Standard_EXPORT static Standard_Real PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D);
//! Returns the resolution on the surface
Standard_EXPORT static Standard_Real PrecSurface(const Handle(Adaptor3d_Surface)& aAHSurf);

View File

@@ -454,7 +454,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

View File

@@ -216,7 +216,7 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update)
exp1.Next();
}
Geom2dAdaptor_Curve aC;
Handle(Geom2dAdaptor_Curve) aC = new Geom2dAdaptor_Curve();
Standard_Real aFirst, aLast;
DataMapOfShapeBox2d aMapShapeBox2d;
for (exp1.Init (myShape, TopAbs_WIRE); exp1.More(); exp1.Next())
@@ -227,15 +227,15 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update)
for (exp2.Init (aWire, TopAbs_EDGE); exp2.More(); exp2.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (exp2.Current());
aC.Load (BRep_Tool::CurveOnSurface (anEdge, TopoDS::Face (myShape), aFirst, aLast));
aC->Load (BRep_Tool::CurveOnSurface (anEdge, TopoDS::Face (myShape), aFirst, aLast));
// To avoid exception in Segment if C1 is BSpline
if (aC.FirstParameter() > aFirst)
if (aC->FirstParameter() > aFirst)
{
aFirst = aC.FirstParameter();
aFirst = aC->FirstParameter();
}
if (aC.LastParameter() < aLast)
if (aC->LastParameter() < aLast)
{
aLast = aC.LastParameter();
aLast = aC->LastParameter();
}
Bnd_Box2d aBoxE;
BndLib_Add2dCurve::Add (aC, aFirst, aLast, 0., aBoxE);
@@ -644,7 +644,8 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
PntSeq.Append( P );
}
Geom2dAdaptor_Curve C1,C2;
Handle(Geom2dAdaptor_Curve) C1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) C2 = new Geom2dAdaptor_Curve();
gp_Pnt2d pfirst1,plast1,pfirst2,plast2;
Standard_Real first1,last1,first2,last2;
Geom2dInt_GInter Inter;
@@ -655,10 +656,10 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
{
const TopoDS_Edge& edg1 = TopoDS::Edge(exp1.Current());
// cur1.Initialize(edg1,F);
C1.Load( BRep_Tool::CurveOnSurface(edg1,F,first1,last1) );
C1->Load( BRep_Tool::CurveOnSurface(edg1,F,first1,last1) );
// To avoid exception in Segment if C1 is BSpline - IFV
if(C1.FirstParameter() > first1) first1 = C1.FirstParameter();
if(C1.LastParameter() < last1 ) last1 = C1.LastParameter();
if(C1->FirstParameter() > first1) first1 = C1->FirstParameter();
if(C1->LastParameter() < last1 ) last1 = C1->LastParameter();
Box1.SetVoid();
if (theMapEdgeBox.IsBound (edg1))
@@ -675,10 +676,10 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
if (!edg1.IsSame(edg2))
{
//cur2.Initialize(edg2,F);
C2.Load( BRep_Tool::CurveOnSurface(edg2,F,first2,last2) );
C2->Load( BRep_Tool::CurveOnSurface(edg2,F,first2,last2) );
// To avoid exception in Segment if C2 is BSpline - IFV
if(C2.FirstParameter() > first2) first2 = C2.FirstParameter();
if(C2.LastParameter() < last2 ) last2 = C2.LastParameter();
if(C2->FirstParameter() > first2) first2 = C2->FirstParameter();
if(C2->LastParameter() < last2 ) last2 = C2->LastParameter();
Box2.SetVoid();
if (theMapEdgeBox.IsBound (edg2))

View File

@@ -98,7 +98,7 @@ inline Standard_Boolean IsOriented(const TopoDS_Shape& S)
}
static
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
void CurveDirForParameter(const Handle(Geom2dAdaptor_Curve)& aC2d,
const Standard_Real aPrm,
gp_Pnt2d& Pnt,
gp_Vec2d& aVec2d);
@@ -415,7 +415,7 @@ Standard_Boolean IsDistanceIn3DTolerance (const gp_Pnt& thePnt_f,
//purpose :
//=======================================================================
static
Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurface,
Standard_Boolean IsDistanceIn2DTolerance (const Handle(BRepAdaptor_Surface)& aFaceSurface,
const gp_Pnt2d& thePnt,
const gp_Pnt2d& thePntRef,
const Standard_Real aTol3d,
@@ -425,8 +425,8 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
const Standard_Boolean = Standard_True)
#endif
{
Standard_Real dumax = 0.01 * (aFaceSurface.LastUParameter() - aFaceSurface.FirstUParameter());
Standard_Real dvmax = 0.01 * (aFaceSurface.LastVParameter() - aFaceSurface.FirstVParameter());
Standard_Real dumax = 0.01 * (aFaceSurface->LastUParameter() - aFaceSurface->FirstUParameter());
Standard_Real dvmax = 0.01 * (aFaceSurface->LastVParameter() - aFaceSurface->FirstVParameter());
Standard_Real dumin = Abs(thePnt.X() - thePntRef.X());
Standard_Real dvmin = Abs(thePnt.Y() - thePntRef.Y());
@@ -451,13 +451,13 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
std::cout << "; VLast = " << aFaceSurface.LastVParameter() << std::endl;
}
#endif
dumax = aFaceSurface.UResolution(aTol3d);
dvmax = aFaceSurface.VResolution(aTol3d);
dumax = aFaceSurface->UResolution(aTol3d);
dvmax = aFaceSurface->VResolution(aTol3d);
gp_Pnt aP;
gp_Vec aDU, aDV;
Standard_Real um = (thePnt.X() + thePntRef.X()) / 2.;
Standard_Real vm = (thePnt.Y() + thePntRef.Y()) / 2.;
aFaceSurface.D1(um, vm, aP, aDU, aDV);
aFaceSurface->D1(um, vm, aP, aDU, aDV);
Standard_Real aMDU = aDU.Magnitude();
if (aMDU > Precision::Confusion())
{
@@ -539,7 +539,7 @@ BRepCheck_Status BRepCheck_Wire::Closed2d(const TopoDS_Face& theFace,
// 20/03/02 akm vvv : (OCC234) Hence this method will be used to check
// both periodic and non-periodic faces
// // this check is for periodic faces
BRepAdaptor_Surface aFaceSurface (theFace, Standard_False);
Handle(BRepAdaptor_Surface) aFaceSurface = new BRepAdaptor_Surface(theFace, Standard_False);
// if (!aFaceSurface.IsUPeriodic() && !aFaceSurface.IsVPeriodic())
// {
// if (Update)
@@ -1004,7 +1004,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
gp_Pnt2d pfirst1,plast1,pfirst2,plast2;
gp_Pnt P3d, P3d2;
Handle(BRepAdaptor_Surface) HS;
Geom2dAdaptor_Curve C1, C2;
Handle(Geom2dAdaptor_Curve) C1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) C2 = new Geom2dAdaptor_Curve();
Geom2dInt_GInter Inter;
IntRes2d_Domain myDomain1;
TopTools_IndexedMapOfOrientedShape EMap;
@@ -1051,14 +1052,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
return(BRepCheck_SelfIntersectingWire);
}
//
C1.Load(pcu);
C1->Load(pcu);
// To avoid exception in Segment if C1 is BSpline - IFV
if(!C1.IsPeriodic()) {
if(C1.FirstParameter() > first1) {
first1 = C1.FirstParameter();
if(!C1->IsPeriodic()) {
if(C1->FirstParameter() > first1) {
first1 = C1->FirstParameter();
}
if(C1.LastParameter() < last1 ){
last1 = C1.LastParameter();
if(C1->LastParameter() < last1 ){
last1 = C1->LastParameter();
}
}
//
@@ -1068,7 +1069,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
BndLib_Add2dCurve::Add(C1, first1, last1, Precision::PConfusion(), boxes(i));
}//if (i == 1) {
else {
C1.Load(tabCur(i));
C1->Load(tabCur(i));
myDomain1 = tabDom[i-1];
}
//
@@ -1099,7 +1100,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
}
else {
gp_Pnt2d aP2d = C1.Value(IP.ParamOnFirst());
gp_Pnt2d aP2d = C1->Value(IP.ParamOnFirst());
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1141,14 +1142,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
if (i == 1) {
tabCur(j) = BRep_Tool::CurveOnSurface(E2,F,first2,last2);
if (!tabCur(j).IsNull() && last2 > first2) {
C2.Load(tabCur(j));
C2->Load(tabCur(j));
// To avoid exception in Segment if C2 is BSpline - IFV
if(!C2.IsPeriodic()) {
if(C2.FirstParameter() > first2) {
first2 = C2.FirstParameter();
if(!C2->IsPeriodic()) {
if(C2->FirstParameter() > first2) {
first2 = C2->FirstParameter();
}
if(C2.LastParameter() < last2 ) {
last2 = C2.LastParameter();
if(C2->LastParameter() < last2 ) {
last2 = C2->LastParameter();
}
}
//
@@ -1169,7 +1170,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
}
}// if (i == 1) {
else {
C2.Load(tabCur(j));
C2->Load(tabCur(j));
}
//
if (boxes(i).IsOut( boxes(j))) {
@@ -1243,7 +1244,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d.Transform(L.Transformation());
}
else {
gp_Pnt2d aP2d = C1.Value(IP_ParamOnFirst);
gp_Pnt2d aP2d = C1->Value(IP_ParamOnFirst);
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
//
@@ -1252,7 +1253,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d2.Transform(L2.Transformation());
}
else {
gp_Pnt2d aP2d = C2.Value(IP_ParamOnSecond);
gp_Pnt2d aP2d = C2->Value(IP_ParamOnSecond);
P3d2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1346,7 +1347,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P1.Transform(L.Transformation());
}
else {
gp_Pnt2d aP2d = C1.Value(u);
gp_Pnt2d aP2d = C1->Value(u);
P1 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1374,7 +1375,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P2.Transform(L2.Transformation());
}
else {
gp_Pnt2d aP2d = C2.Value(u);
gp_Pnt2d aP2d = C2->Value(u);
P2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1448,8 +1449,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
if(aPCR1!=IntRes2d_Middle && aPCR2!=IntRes2d_Middle) {
GeomAbs_CurveType aCT1, aCT2;
//ZZ
aCT1=C1.GetType();
aCT2=C2.GetType();
aCT1=C1->GetType();
aCT2=C2->GetType();
if (aCT1==GeomAbs_Line && aCT2==GeomAbs_Line) {
// check for the two lines coincidence
Standard_Real aPAR_T, aT11, aT12, aT21, aT22, aT1m, aT2m;
@@ -1464,8 +1465,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
aTol2=aTolE1+aTolE2;
aTol2=aTol2*aTol2;
//
aL1=C1.Line();
aL2=C2.Line();
aL1=C1->Line();
aL2=C2->Line();
//
aT11=PSeg[0].ParamOnFirst();
aT12=PSeg[1].ParamOnFirst();
@@ -1473,7 +1474,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
aT22=PSeg[1].ParamOnSecond();
//
aT1m=(1.-aPAR_T)*aT11 + aPAR_T*aT12;
aP1m=C1.Value(aT1m);
aP1m=C1->Value(aT1m);
//
aD2=aL2.SquareDistance(aP1m);
if (aD2<aTol2) {
@@ -1503,14 +1504,14 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
P3d = ConS->Value(IP_ParamOnFirst);
P3d.Transform(L.Transformation());
} else {
gp_Pnt2d aP2d = C1.Value(IP_ParamOnFirst);
gp_Pnt2d aP2d = C1->Value(IP_ParamOnFirst);
P3d = HS->Value(aP2d.X(), aP2d.Y());
}
if (!ConS2.IsNull()) {
P3d2 = ConS2->Value(IP_ParamOnSecond);
P3d2.Transform(L2.Transformation());
} else {
gp_Pnt2d aP2d = C2.Value(IP_ParamOnSecond);
gp_Pnt2d aP2d = C2->Value(IP_ParamOnSecond);
P3d2 = HS->Value(aP2d.X(), aP2d.Y());
}
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End
@@ -1692,7 +1693,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
Standard_Real a_gpResolution=gp::Resolution();
TopAbs_Orientation aVOrientation, anEdgOrientation;
Standard_Real aParam = 0.0, aFirstParam = 0.0, aLastParam = 0.0, aParPiv = 0.0;
BRepAdaptor_Surface aFaceSurface(theFace,Standard_False); // no restriction
Handle(BRepAdaptor_Surface) aFaceSurface = new BRepAdaptor_Surface(theFace, Standard_False); // no restriction
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirstParam, aLastParam);
if (C2d.IsNull())// JAG 10.12.96
@@ -1705,7 +1706,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
aMinAngle = RealLast();
aMaxAngle = RealFirst();
CurveDirForParameter(C2d, aParPiv, aPntRef, aDerRef);
CurveDirForParameter(new Geom2dAdaptor_Curve(C2d), aParPiv, aPntRef, aDerRef);
if (aVOrientation != anEdgOrientation)
aDerRef.Reverse();
@@ -1727,7 +1728,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
if(!IsDistanceIn2DTolerance(aFaceSurface, aPnt, aPntRef, aTol3d, Standard_False))
continue;
CurveDirForParameter(aCA, aParam, aPnt, aDer);
CurveDirForParameter(new Geom2dAdaptor_Curve(aCA), aParam, aPnt, aDer);
if (aVOrientation == anE.Orientation())
aDer.Reverse();
@@ -1820,7 +1821,7 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
//function : CurveDirForParameter
//purpose :
//=======================================================================
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
void CurveDirForParameter(const Handle(Geom2dAdaptor_Curve)& aC2d,
const Standard_Real aPrm,
gp_Pnt2d& Pnt,
gp_Vec2d& aVec2d)
@@ -1828,11 +1829,11 @@ void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
Standard_Real aTol=gp::Resolution();
Standard_Integer i;
aC2d.D1(aPrm, Pnt, aVec2d);
aC2d->D1(aPrm, Pnt, aVec2d);
//
if (aVec2d.Magnitude() <= aTol) {
for (i = 2; i <= 100; i++){
aVec2d = aC2d.DN(aPrm, i);
aVec2d = aC2d->DN(aPrm, i);
if (aVec2d.Magnitude() > aTol) {
break;
}

View File

@@ -105,7 +105,7 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& theF,
aMaxDist=RealLast();
aIndice=0;
//
BRepAdaptor_Surface aSurf(theF, Standard_False);
Handle(BRepAdaptor_Surface) aSurf = new BRepAdaptor_Surface(theF, Standard_False);
BRepTools::UVBounds(theF, aU1, aU2, aV1, aV2);
aExtrema.Initialize(aSurf, aU1, aU2, aV1, aV2, theTol, theTol);
//

View File

@@ -47,7 +47,7 @@ void GetTangentAsChord(const Handle(Geom2d_Curve)& thePCurve,
static
void RefineTolerance(const TopoDS_Face& aF,
const Geom2dAdaptor_Curve& aC,
const Handle(Geom2dAdaptor_Curve)& aC,
const Standard_Real aT,
Standard_Real& aTolZ);
@@ -55,7 +55,7 @@ static
Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter,
const TopoDS_Face& theF,
const gp_Lin2d& theL,
const Geom2dAdaptor_Curve& theCur,
const Handle(Geom2dAdaptor_Curve)& theCur,
Standard_Real& theTolZ,
const Standard_Real theFin,
const Standard_Real theDeb);
@@ -66,8 +66,8 @@ void CheckSkip(Geom2dInt_GInter& theInter,
const BRepClass_Edge& theE,
const Handle(Geom2d_Curve)& theC2D,
const IntRes2d_Domain& theDL,
Geom2dAdaptor_Curve& theCur,
const Geom2dAdaptor_Curve& theCGA,
Handle(Geom2dAdaptor_Curve)& theCur,
const Handle(Geom2dAdaptor_Curve)& theCGA,
Standard_Real& theFin,
Standard_Real& theDeb,
const Standard_Real theMaxTol,
@@ -162,7 +162,7 @@ Standard_Boolean IsInter(Bnd_Box2d& theBox,
Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter,
const TopoDS_Face& theF,
const gp_Lin2d& theL,
const Geom2dAdaptor_Curve& theCur,
const Handle(Geom2dAdaptor_Curve)& theCur,
Standard_Real& theTolZ,
const Standard_Real theFin,
const Standard_Real theDeb)
@@ -224,8 +224,8 @@ void CheckSkip(Geom2dInt_GInter& theInter,
const BRepClass_Edge& theE,
const Handle(Geom2d_Curve)& theC2D,
const IntRes2d_Domain& theDL,
Geom2dAdaptor_Curve& theCur,
const Geom2dAdaptor_Curve& theCGA,
Handle(Geom2dAdaptor_Curve)& theCur,
const Handle(Geom2dAdaptor_Curve)& theCGA,
Standard_Real& theFin,
Standard_Real& theDeb,
const Standard_Real theMaxTol,
@@ -313,26 +313,26 @@ void CheckSkip(Geom2dInt_GInter& theInter,
return;
}
// if we got
theCur.Load(aSkipC2D);
if (theCur.Curve().IsNull())
theCur->Load(aSkipC2D);
if (theCur->Curve().IsNull())
{
return;
}
Standard_Real atoldeb = 1.e-5, atolfin = 1.e-5;
theDeb = theCur.FirstParameter();
theFin = theCur.LastParameter();
theCur.D0(theDeb, thePdeb);
theCur.D0(theFin, thePfin);
theDeb = theCur->FirstParameter();
theFin = theCur->LastParameter();
theCur->D0(theDeb, thePdeb);
theCur->D0(theFin, thePfin);
IntRes2d_Domain aDE(thePdeb, theDeb, atoldeb, thePfin, theFin, atolfin);
// temporary periodic domain
if (theCur.Curve()->IsPeriodic())
if (theCur->Curve()->IsPeriodic())
{
aDE.SetEquivalentParameters(theCur.FirstParameter(),
theCur.FirstParameter() +
theCur.Curve()->LastParameter() -
theCur.Curve()->FirstParameter());
aDE.SetEquivalentParameters(theCur->FirstParameter(),
theCur->FirstParameter() +
theCur->Curve()->LastParameter() -
theCur->Curve()->FirstParameter());
}
theInter = Geom2dInt_GInter(theCGA, theDL, theCur, aDE,
@@ -373,7 +373,7 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
aPntF = L.Location();
}
//
Geom2dAdaptor_Curve C(aC2D, deb, fin);
Handle(Geom2dAdaptor_Curve) C = new Geom2dAdaptor_Curve(aC2D, deb, fin);
//
// Case of "ON": direct check of belonging to edge
// taking into account the tolerance
@@ -406,8 +406,8 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
}
}
gp_Pnt2d pdeb, pfin;
C.D0(deb, pdeb);
C.D0(fin, pfin);
C->D0(deb, pdeb);
C->D0(fin, pfin);
Standard_Real toldeb = 1.e-5, tolfin = 1.e-5;
IntRes2d_Domain DL;
@@ -421,15 +421,15 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
IntRes2d_Domain DE(pdeb, deb, toldeb, pfin, fin, tolfin);
// temporary periodic domain
if (C.Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C.FirstParameter(),
C.FirstParameter() +
C.Curve()->LastParameter() -
C.Curve()->FirstParameter());
if (C->Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C->FirstParameter(),
C->FirstParameter() +
C->Curve()->LastParameter() -
C->Curve()->FirstParameter());
}
Handle(Geom2d_Line) GL = new Geom2d_Line(L);
Geom2dAdaptor_Curve CGA(GL);
Handle(Geom2dAdaptor_Curve) CGA = new Geom2dAdaptor_Curve(GL);
Geom2dInt_GInter Inter(CGA, DL, C, DE,
Precision::PConfusion(),
Precision::PIntersection());
@@ -481,7 +481,7 @@ void BRepClass_Intersector::LocalGeometry(const BRepClass_Edge& E,
//purpose :
//=======================================================================
void RefineTolerance(const TopoDS_Face& aF,
const Geom2dAdaptor_Curve& aC,
const Handle(Geom2dAdaptor_Curve)& aC,
const Standard_Real aT,
Standard_Real& aTolZ)
{
@@ -498,7 +498,7 @@ void RefineTolerance(const TopoDS_Face& aF,
aURes=aBAS.UResolution(aTolZ);
aVRes=aBAS.VResolution(aTolZ);
//
aC.D1(aT, aP2D, aV2D);
aC->D1(aT, aP2D, aV2D);
gp_Dir2d aD2D(aV2D);
//
aTolX=aURes*aD2D.Y()+aVRes*aD2D.X();

View File

@@ -38,7 +38,7 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorPoint::Accept (const Standard_Int
Standard_Real EdgeTSq = BRep_Tool::Tolerance(E);
EdgeTSq *= EdgeTSq;
Standard_Real f, l;
BRepAdaptor_Curve C(E);
Handle(BRepAdaptor_Curve) C = new BRepAdaptor_Curve(E);
BRep_Tool::Range(E,f,l);
// Edge-Point interference.
@@ -86,11 +86,11 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorLine::Accept (const Standard_Inte
Standard_Real EdgeTSq = BRep_Tool::Tolerance(E);
EdgeTSq *= EdgeTSq;
Standard_Real f, l;
BRepAdaptor_Curve C(E);
Handle(BRepAdaptor_Curve) C = new BRepAdaptor_Curve(E);
BRep_Tool::Range(E, f, l);
// Edge-Line interference.
Extrema_ExtCC ExtCC(C, myLC, f, l, myLC.FirstParameter(), myLC.LastParameter());
Extrema_ExtCC ExtCC(C, myLC, f, l, myLC->FirstParameter(), myLC->LastParameter());
if (ExtCC.IsDone())
{
if (ExtCC.IsParallel())

View File

@@ -83,6 +83,7 @@ public:
BRepClass3d_BndBoxTreeSelectorLine(const TopTools_IndexedMapOfShape& theMapOfShape)
: BRepClass3d_BndBoxTreeSelectorLine::Selector(),
myMapOfShape(theMapOfShape),
myLC(new GeomAdaptor_Curve()),
myIsValid(Standard_True)
{}
@@ -98,7 +99,7 @@ public:
const Standard_Real theMaxParam)
{
myL = theL;
myLC.Load(new Geom_Line(theL), -Precision::PConfusion(), theMaxParam);
myLC->Load(new Geom_Line(theL), -Precision::PConfusion(), theMaxParam);
}
void GetEdgeParam(const Standard_Integer i,
@@ -153,7 +154,7 @@ private:
gp_Lin myL;
NCollection_Sequence<EdgeParam> myEP; //output result (edge vs line)
NCollection_Sequence<VertParam> myVP; //output result (vertex vs line)
GeomAdaptor_Curve myLC;
Handle(GeomAdaptor_Curve) myLC;
Standard_Boolean myIsValid;
};

View File

@@ -376,7 +376,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer,
if (Intersector3d.IsParallel())
{
//Check distance between surface and point
BRepAdaptor_Surface aBAS(f, Standard_False);
Handle(BRepAdaptor_Surface) aBAS = new BRepAdaptor_Surface(f, Standard_False);
Extrema_ExtPS aProj(P, aBAS, Precision::PConfusion(), Precision::PConfusion());
if (aProj.IsDone() && aProj.NbExt() > 0)
{

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