mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
9 Commits
CR29144_1
...
CR29523_v7
Author | SHA1 | Date | |
---|---|---|---|
|
99ecc57f23 | ||
|
7908f97c1b | ||
|
9a49e2ce57 | ||
|
bf878e54e3 | ||
|
efb8681bfc | ||
|
34b2e62bd6 | ||
|
8c2adc035d | ||
|
a829053aed | ||
|
f109d88899 |
@@ -25,7 +25,7 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if (WIN32)
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
else()
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
|
||||
|
@@ -142,6 +142,9 @@ proc wokdep:gui:UpdateList {} {
|
||||
if { "$::HAVE_GL2PS" == "true" } {
|
||||
lappend anIncErrs "Error: gl2ps can not be used with OpenGL ES"
|
||||
}
|
||||
if { "$::HAVE_D3D" == "true" } {
|
||||
lappend anIncErrs "Error: Direct3D can not be used with OpenGL ES"
|
||||
}
|
||||
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
wokdep:SearchGLES anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
|
@@ -655,8 +655,6 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
|
||||
# Generates Doxygen configuration file for Overview documentation
|
||||
proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
|
||||
global module_dependency
|
||||
|
||||
set inputDir [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
|
||||
|
||||
set TEMPLATES_DIR [OCCDoc_GetDoxDir]/resources
|
||||
@@ -727,16 +725,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
||||
set name OCCT
|
||||
}
|
||||
|
||||
OCCDoc_LoadData "${productsPath}"
|
||||
|
||||
# Add all dependencies of modules to the graph
|
||||
set additional_modules {}
|
||||
foreach module $modules {
|
||||
set additional_modules [list {*}$additional_modules {*}$module_dependency($module)]
|
||||
}
|
||||
set modules [list {*}$modules {*}$additional_modules]
|
||||
set modules [lsort -unique $modules]
|
||||
|
||||
# Get list of header files in the specified modules
|
||||
set filelist {}
|
||||
foreach module $modules {
|
||||
|
@@ -82,8 +82,6 @@ set "VisualStudioExpressName=VCExpress"
|
||||
|
||||
if not "%DevEnvDir%" == "" (
|
||||
rem If DevEnvDir is already defined (e.g. in custom.bat), use that value
|
||||
) else if /I "%VCFMT%" == "vc9" (
|
||||
set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
@@ -103,22 +101,12 @@ if not "%DevEnvDir%" == "" (
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
|
||||
echo one of:
|
||||
echo vc9 = VS 2008 ^(SP1^)
|
||||
echo vc10 = VS 2010 ^(SP3^)
|
||||
echo vc11 = VS 2012 ^(SP3^)
|
||||
echo vc12 = VS 2013 ^(SP3^)
|
||||
echo vc14 = VS 2015
|
||||
echo vc141 = VS 2017
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
)
|
||||
|
||||
rem ----- Parsing vcvarsall for qt samples and define PlatformToolset -----
|
||||
if /I "%VCFMT%" == "vc9" (
|
||||
set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v90"
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
if /I "%VCFMT%" == "vc10" (
|
||||
set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v100"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
@@ -138,8 +126,9 @@ if /I "%VCFMT%" == "vc9" (
|
||||
) else if /I "%VCFMT%" == "gcc" (
|
||||
rem MinGW
|
||||
) else (
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
|
||||
echo one of: vc10 ^(VS 2010 SP3^), vc11 ^(VS 2012 SP3^), vc12 ^(VS 2013^) or vc14 ^(VS 2015^)
|
||||
exit
|
||||
)
|
||||
|
||||
set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
|
||||
|
@@ -52,8 +52,6 @@ set "VisualStudioExpressName=VCExpress"
|
||||
|
||||
if not "%DevEnvDir%" == "" (
|
||||
rem If DevEnvDir is already defined (e.g. in custom.bat), use that value
|
||||
) else if /I "%VCFMT%" == "vc9" (
|
||||
set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
@@ -78,10 +76,7 @@ if not "%DevEnvDir%" == "" (
|
||||
)
|
||||
|
||||
rem ----- Parsing vcvarsall for qt samples and define PlatformToolset -----
|
||||
if /I "%VCFMT%" == "vc9" (
|
||||
set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v90"
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
if /I "%VCFMT%" == "vc10" (
|
||||
set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v100"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
|
@@ -24,7 +24,6 @@
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -121,7 +120,7 @@
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -219,7 +218,6 @@
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -313,7 +311,7 @@
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
ManagedExtensions="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
|
282
data/occ/Box.brep
Normal file
282
data/occ/Box.brep
Normal file
@@ -0,0 +1,282 @@
|
||||
DBRep_DrawableShape
|
||||
|
||||
CASCADE Topology V1, (c) Matra-Datavision
|
||||
Locations 0
|
||||
Curve2ds 24
|
||||
1 0 0 1 0
|
||||
1 0 0 1 0
|
||||
1 50 0 0 -1
|
||||
1 0 0 0 1
|
||||
1 0 -80 1 0
|
||||
1 0 0 1 0
|
||||
1 0 0 0 -1
|
||||
1 0 0 0 1
|
||||
1 0 0 1 0
|
||||
1 0 77 1 0
|
||||
1 50 0 0 -1
|
||||
1 77 0 0 1
|
||||
1 0 -80 1 0
|
||||
1 0 77 1 0
|
||||
1 0 0 0 -1
|
||||
1 77 0 0 1
|
||||
1 0 0 0 1
|
||||
1 0 0 1 0
|
||||
1 50 0 0 1
|
||||
1 0 0 1 0
|
||||
1 0 0 0 1
|
||||
1 0 80 1 0
|
||||
1 50 0 0 1
|
||||
1 0 80 1 0
|
||||
Curves 12
|
||||
1 821 803 0 0 0 1
|
||||
1 821 803 50 0 1 0
|
||||
1 821 883 0 0 0 1
|
||||
1 821 803 0 0 1 0
|
||||
1 898 803 0 0 0 1
|
||||
1 898 803 50 0 1 0
|
||||
1 898 883 0 0 0 1
|
||||
1 898 803 0 0 1 0
|
||||
1 821 803 0 1 0 0
|
||||
1 821 803 50 1 0 0
|
||||
1 821 883 0 1 0 0
|
||||
1 821 883 50 1 0 0
|
||||
Polygon3D 0
|
||||
PolygonOnTriangulations 0
|
||||
Surfaces 6
|
||||
1 821 803 0 1 0 0 0 0 1 0 -1 0
|
||||
1 821 803 0 0 1 0 0 0 1 1 0 0
|
||||
1 821 803 50 0 0 1 1 0 0 0 1 0
|
||||
1 821 883 0 0 1 0 0 0 1 1 0 0
|
||||
1 821 803 0 0 0 1 1 0 0 0 1 0
|
||||
1 898 803 0 1 0 0 0 0 1 0 -1 0
|
||||
Triangulations 0
|
||||
|
||||
TShapes 34
|
||||
Ve
|
||||
1e-007
|
||||
821 803 50
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ve
|
||||
1e-007
|
||||
821 803 0
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 1 0 0 50
|
||||
2 1 1 0 0 50
|
||||
2 2 2 0 0 50
|
||||
0
|
||||
|
||||
0101000
|
||||
-34 0 +33 0 *
|
||||
Ve
|
||||
1e-007
|
||||
821 883 50
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 2 0 0 80
|
||||
2 3 1 0 0 80
|
||||
2 4 3 0 0 80
|
||||
0
|
||||
|
||||
0101000
|
||||
-31 0 +34 0 *
|
||||
Ve
|
||||
1e-007
|
||||
821 883 0
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 3 0 0 50
|
||||
2 5 1 0 0 50
|
||||
2 6 4 0 0 50
|
||||
0
|
||||
|
||||
0101000
|
||||
-31 0 +29 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 4 0 0 80
|
||||
2 7 1 0 0 80
|
||||
2 8 5 0 0 80
|
||||
0
|
||||
|
||||
0101000
|
||||
-29 0 +33 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-32 0 -30 0 +28 0 +27 0 *
|
||||
Fa
|
||||
0 1e-007 1 0
|
||||
|
||||
0111000
|
||||
+26 0 *
|
||||
Ve
|
||||
1e-007
|
||||
898 803 50
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ve
|
||||
1e-007
|
||||
898 803 0
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 5 0 0 50
|
||||
2 9 6 0 0 50
|
||||
2 10 2 0 0 50
|
||||
0
|
||||
|
||||
0101000
|
||||
-24 0 +23 0 *
|
||||
Ve
|
||||
1e-007
|
||||
898 883 50
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 6 0 0 80
|
||||
2 11 6 0 0 80
|
||||
2 12 3 0 0 80
|
||||
0
|
||||
|
||||
0101000
|
||||
-21 0 +24 0 *
|
||||
Ve
|
||||
1e-007
|
||||
898 883 0
|
||||
0 0
|
||||
|
||||
0101100
|
||||
*
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 7 0 0 50
|
||||
2 13 6 0 0 50
|
||||
2 14 4 0 0 50
|
||||
0
|
||||
|
||||
0101000
|
||||
-21 0 +19 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 8 0 0 80
|
||||
2 15 6 0 0 80
|
||||
2 16 5 0 0 80
|
||||
0
|
||||
|
||||
0101000
|
||||
-19 0 +23 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-22 0 -20 0 +18 0 +17 0 *
|
||||
Fa
|
||||
0 1e-007 6 0
|
||||
|
||||
0111000
|
||||
+16 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 9 0 0 77
|
||||
2 17 2 0 0 77
|
||||
2 18 5 0 0 77
|
||||
0
|
||||
|
||||
0101000
|
||||
-23 0 +33 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 10 0 0 77
|
||||
2 19 2 0 0 77
|
||||
2 20 3 0 0 77
|
||||
0
|
||||
|
||||
0101000
|
||||
-24 0 +34 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-14 0 -22 0 +13 0 +32 0 *
|
||||
Fa
|
||||
0 1e-007 2 0
|
||||
|
||||
0111000
|
||||
+12 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 11 0 0 77
|
||||
2 21 4 0 0 77
|
||||
2 22 5 0 0 77
|
||||
0
|
||||
|
||||
0101000
|
||||
-19 0 +29 0 *
|
||||
Ed
|
||||
1e-007 1 1 0
|
||||
1 12 0 0 77
|
||||
2 23 4 0 0 77
|
||||
2 24 3 0 0 77
|
||||
0
|
||||
|
||||
0101000
|
||||
-21 0 +31 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-10 0 -18 0 +9 0 +28 0 *
|
||||
Fa
|
||||
0 1e-007 4 0
|
||||
|
||||
0111000
|
||||
+8 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-27 0 -10 0 +17 0 +14 0 *
|
||||
Fa
|
||||
0 1e-007 5 0
|
||||
|
||||
0111000
|
||||
+6 0 *
|
||||
Wi
|
||||
|
||||
0101000
|
||||
-30 0 -9 0 +20 0 +13 0 *
|
||||
Fa
|
||||
0 1e-007 3 0
|
||||
|
||||
0111000
|
||||
+4 0 *
|
||||
Sh
|
||||
|
||||
0101100
|
||||
-25 0 +15 0 -11 0 +7 0 -5 0 +3 0 *
|
||||
So
|
||||
|
||||
1100000
|
||||
+2 0 *
|
||||
|
||||
+1 0
|
2562
data/occ/hammer.brep
2562
data/occ/hammer.brep
File diff suppressed because one or more lines are too long
@@ -192,11 +192,7 @@ Use prefix <i>bug</i> followed by Mantis issue ID and, if necessary, additional
|
||||
* If the test case reports error due to an existing problem and the fix is not available, add @ref testmanual_3_6 "TODO" statement for each error to mark it as a known problem. The TODO statements must be specific so as to match the actually generated messages but not all similar errors.
|
||||
* To check expected output which should be obtained as the test result, add @ref testmanual_3_7 "REQUIRED" statement for each line of output to mark it as required.
|
||||
* If the test case produces error messages (contained in parse.rules), which are expected in that test and should not be considered as its failure (e.g. test for *checkshape* command), add REQUIRED statement for each error to mark it as required output.
|
||||
4. To check whether the data files needed for the test are already present in the database, use DRAW command *testfile* (see below).
|
||||
If the data file is already present, use it for new test instead of adding a duplicate.
|
||||
If the data file(s) are not yet present in the test database, put them to some folder and add it to the environment variable *CSF_TestDataPath* to be found by the test system.
|
||||
Information on where the data files can be accessed by OCC team for putting to official database should be provided in comment to Mantis issue, clearly indicating how names of the files used by the test script match the actual names of the files.
|
||||
The simplest way is to attach the data files to the Mantis issue, with the same names as used by the test script.
|
||||
4. If the test uses data file(s) that are not yet present in the test database, it is possible to put them to (sub)directory pointed out by *CSF_TestDataPath* variable for running test. The files should be attached to the Mantis issue corresponding to the tested modification.
|
||||
5. Check that the test case runs as expected (test for fix: OK with the fix, FAILED without the fix; test for existing problem: BAD), and integrate it to the Git branch created for the issue.
|
||||
|
||||
Example:
|
||||
@@ -222,33 +218,6 @@ fixshape result a 0.01 0.01
|
||||
checkshape result
|
||||
~~~~~
|
||||
|
||||
DRAW command testfile should be used to check the data files being used by the test for possible duplication of content or names.
|
||||
The command accepts list of paths to files being checked as single argument, and will give conclusion on each of the files, for instance:
|
||||
|
||||
~~~~~
|
||||
Draw[1]> testfile [glob /my/data/path/bug12345*]
|
||||
Collecting info on test data files repository...
|
||||
Checking new file(s)...
|
||||
|
||||
* /my/data/path/bug12345.brep: duplicate
|
||||
already present under name bug28773_1.brep
|
||||
--> //server/occt_tests_data/public/brep/bug28773_1.brep
|
||||
|
||||
* /my/data/path/cadso.brep: new file
|
||||
Warning: DOS encoding detected, consider converting to
|
||||
UNIX unless DOS line ends are needed for the test
|
||||
Warning: shape contains triangulation (946 triangles),
|
||||
consider removing them unless they are needed for the test!
|
||||
BREP size=201 KiB, nbfaces=33, nbedges=94 -> private
|
||||
|
||||
* /my/data/path/case_8_wire3.brep: already present
|
||||
--> //server/occt_tests_data/public/brep/case_8_wire3.brep
|
||||
|
||||
* /my/data/path/case_8_wire4.brep: error
|
||||
name is already used by existing file
|
||||
--> //server/occt_tests_data/public/brep/case_8_wire4.brep
|
||||
~~~~~
|
||||
|
||||
@section testmanual_2 Organization of Test Scripts
|
||||
|
||||
@subsection testmanual_2_1 General Layout
|
||||
|
@@ -28,22 +28,13 @@ https://www.opencascade.com
|
||||
License
|
||||
--------
|
||||
|
||||
Open CASCADE Technology is free software; you can redistribute it and / or modify it under the terms of the
|
||||
@ref license_lgpl_21 "GNU Lesser General Public License (LGPL) version 2.1", with additional @ref occt_lgpl_exception "exception".
|
||||
Open CASCADE Technology is free software; you can redistribute it and / or
|
||||
modify it under the terms of the
|
||||
@ref license_lgpl_21 "GNU Lesser General Public License (LGPL) version 2.1",
|
||||
with additional @ref occt_lgpl_exception "exception".
|
||||
|
||||
Note that LGPL imposes some obligations on the application linked with Open CASCADE Technology.
|
||||
If you wish to use OCCT in a proprietary application, please, pay special attention to address the requirements of LGPL section 6.
|
||||
At minimum the following should be considered:
|
||||
1. Add the notice visible to the users of your application clearly stating that Open CASCADE Technology is used in this application, and that they have rights in this regard according to LGPL.
|
||||
Such notice can be added in About dialog box (this is mandatory if this box contains copyright statements) or a similar place and/or in the documentation.
|
||||
The text of LGPL license should be accessible to the user.
|
||||
2. Make the copy of OCCT sources used by the application available to its users, and if necessary provide instructions on how to build it in a way compatible with the application.
|
||||
3. Ensure that the user actually can exercise the right to run your application with a modified version of OCCT.
|
||||
If the application is distributed in a form that does not allow the user to modify OCCT part (e.g. the application is linked to OCCT statically or is distributed via AppStore on iOS, GooglePlay on Android, Windows Store, etc.),
|
||||
the application should be provided separately in a modifiable form, with all materials needed for the user to be able to run the application with a modified version of OCCT.
|
||||
|
||||
If you want to use Open CASCADE Technology without being bound by LGPL requirements,
|
||||
please <a href="https://www.opencascade.com/contact">contact Open CASCADE company</a> for a commercial license.
|
||||
Alternatively, Open CASCADE Technology may be used under the terms of Open
|
||||
CASCADE commercial license or contractual agreement.
|
||||
|
||||
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
|
||||
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
|
||||
@@ -205,9 +196,9 @@ for which OCCT is certified to work.
|
||||
|
||||
| OS | Compiler |
|
||||
| --------- | ----------- |
|
||||
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1<sup>1</sup>, 2012 Update 4, 2013 Update 5, 2015, 2017 <br> GCC 4.3+ (Mingw-w64)|
|
||||
| Windows | Microsoft Visual Studio: 2010 SP1<sup>1</sup>, 2012 Update 4, 2013 Update 5, 2015, 2017 <br> Intel C++ Composer XE 2013 SP1 <br> GCC 4.3+ (Mingw-w64)|
|
||||
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
|
||||
| OS X / macOS | XCode 6 or newer |
|
||||
| OS X | XCode 6 or newer |
|
||||
| Android | NDK r10, GNU gcc 4.8 or newer |
|
||||
|
||||
1) VC++ 10 64-bit is used for regular testing and for building
|
||||
|
@@ -1481,7 +1481,7 @@ General types of STEP entities imported by OCCT are listed in the table below:
|
||||
|Datum_Feature|XCAFDoc_Datum|
|
||||
|Datum_Target|XCAFDoc_Datum|
|
||||
|
||||
Processing of GD&T is realized in accordance with <a href="https://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> for AP242.
|
||||
Processing of GD&T is realized in accordance with <a href="http://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> for AP242.
|
||||
The general restriction is that OCCT STEP Reader imports GD&T assigned only to shapes (faces, edges, vertices, etc) or to shape groups from general shape model i.e. any constructive geometries are not translated as referenced shapes.
|
||||
|
||||
#### Dimensions
|
||||
|
@@ -91,59 +91,26 @@ XDE can read and write colors and layers assigned to shapes or their subparts (d
|
||||
|
||||
@figure{/user_guides/xde/images/xde_image006.png,"Colors and Layers",240}
|
||||
|
||||
@subsection occt_xde_1_7 Geometric Dimensions & Tolerances (GD&T)
|
||||
|
||||
GD&T are a type of Product and Manufacturing Information (PMI) that can be either computed automatically by a CAD system,
|
||||
or entered manually by the user. For detailed information use <a href="https://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">CAx-IF Recommended Practices
|
||||
for the Representation and Presentation of Product Manufacturing Information (PMI) (AP242)</a>
|
||||
|
||||
XDE can read and write GD&T data of the following types:
|
||||
* dimensions, such as distance, length, radius and so on;
|
||||
* geometric tolerances;
|
||||
* datums, i.e a theoretically exact geometric references, such as point, line or plane, to which toleranced features are related.
|
||||
|
||||
XDE supports two presentations of GD&T data:
|
||||
* semantic presentation, i.e. data is stored in a machine-consumable way and includes all information required to understand the
|
||||
specification without the aid of any presentation elements;
|
||||
* tessellated presentation, i.e. data is displayed in a human-readable way.
|
||||
|
||||
@subsection occt_xde_1_8 Clipping planes
|
||||
|
||||
XDE supports reading from STEP and storing named planes used for clipping.
|
||||
Currently, XDE supports saving of clipping planes in XBF format only.
|
||||
|
||||
XDE provides capabilities for adding, editing and removing clipping planes.
|
||||
|
||||
@subsection occt_xde_1_9 Saved views
|
||||
|
||||
XDE supports reading from STEP views. Views allow to save information about camera parameters (position, direction, zoom factor, etc.)
|
||||
and visible shapes, PMIs, used clipping planes and notes. Currently, XDE supports saving of clipping planes in XBF format only.
|
||||
|
||||
XDE provides the following view management capabilities:
|
||||
* add/remove views;
|
||||
* set view camera parameters;
|
||||
* set visible shapes, PMIs, used clipping planes and notes.
|
||||
|
||||
@subsection occt_xde_1_10 Custom notes
|
||||
@subsection occt_xde_1_7 Custom notes
|
||||
|
||||
Custom notes is a kind of application-specific data attached to assembly items, their attributes and sub-shapes. Basically, there are simple textual comments, binary data and other application-specific data. Each note is provided with a timestamp and the user who created it.
|
||||
Custom notes is a kind of application specific data attached to assembly items, their attributes and sub-shapes. Basically, there are simple textual comments, binary data and other application specific data. Each note is provided with a timestamp and the user created it.
|
||||
|
||||
Notes API provides the following functionality:
|
||||
* Returns the total number of notes and annotated items;
|
||||
* Returns labels for all notes and annotated items;
|
||||
* Returns total number of notes and annotated items
|
||||
* Returns labels for all notes and annotated items
|
||||
* Creates notes:
|
||||
- Comment note from a text string;
|
||||
- Binary data note from a file or byte array;
|
||||
* Checks if an assembly item is annotated;
|
||||
* Finds a label for the annotated item;
|
||||
* Returns all note labels for the annotated item;
|
||||
* Adds a note to item(s):
|
||||
- Assembly item;
|
||||
- Assembly item attribute;
|
||||
- Assembly item subshape index;
|
||||
* Removes note(s) from an annotated assembly item; orphan note(s) might be deleted optionally (items without linked notes will be deleted automatically);
|
||||
* Deletes note(s) and removes them from annotated items;
|
||||
* Gets / deletes orphan notes.
|
||||
- Comment note from a text string
|
||||
- Binary data note from a file or byte array
|
||||
* Checks if an assembly item is annotated
|
||||
* Finds a label for the annotated item
|
||||
* Returns all note labels for the annotated item
|
||||
* Add a note to item(s):
|
||||
- Assembly item
|
||||
- Assembly item attribute
|
||||
- Assembly item subshape index
|
||||
* Remove note(s) from an annotated assembly item; orphan note(s) might be deleted optionally (items without linked notes will be deleted automatically)
|
||||
* Delete note(s) and removes them from annotated items
|
||||
* Get / delete orphan notes
|
||||
|
||||
@section occt_xde_2 Working with XDE
|
||||
|
||||
@@ -537,7 +504,7 @@ XDE can read and write colors and layers assigned to shapes or their subparts (d
|
||||
|
||||
@figure{/user_guides/xde/images/239_xde_12_400.png,"Motor Head",240}
|
||||
|
||||
In an XDE document, colors are managed by the class *XCAFDoc_ColorTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The Property itself is defined as an *XCAFDoc_Color*, sub-class of *TDF_Attribute*.
|
||||
In an XDE document, colors are managed by the class *XCAFDoc_ColorTool*. This is done with the same principles as for ShapeTool with Shapes, and with the same capability of having a tool on the Main Label, or on any sub-label. The Property itself is defined as an *XCAFDoc_Color*, sub-class of *TDF_Attribute*.
|
||||
|
||||
Colors are stored in a child of the starting document label: it is the second level (0.1.2), while Shapes are at the first level. Each color then corresponds to a dedicated label, the property itself is a Quantity_Color, which has a name and value for Red, Green, Blue. A Color may be attached to Surfaces (flat colors) or to Curves (wireframe colors), or to both. A Color may be attached to a sub-shape. In such a case, the sub-shape (and its own sub-shapes) takes its own Color as a priority.
|
||||
|
||||
@@ -660,274 +627,29 @@ To remove a Color and all the references to it (so that the related shapes will
|
||||
myColors->RemoveColor(ColLabel);
|
||||
~~~~~
|
||||
|
||||
@subsection occt_xde_2_7 Geometric Dimensions & Tolerances (GD&T)
|
||||
@subsection occt_xde_2_7 Custom notes
|
||||
|
||||
XDE can read and write GD&T assigned to shapes or their subparts (down to the level of faces and edges) to and from STEP formats.
|
||||
In an XDE document, custom notes are managed by the class *XCAFDoc_NotesTool*. This is done with the same principles as for ShapeTool with Shapes, and with the same capability of having a tool on the Main Label, or on any sub-label. The Property itself is defined as sub-classes of an *XCAFDoc_Note* abstract class, which is a sub-class of *TDF_Attribute* one.
|
||||
|
||||
In an XDE document, GD&T are managed by the class *XCAFDoc_DimTolTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The GD&T entities themselves are defined as the following sub-classes of *TDF_Attribute*:
|
||||
* *XCAFDoc_Dimension* - for dimensions;
|
||||
* *XCAFDoc_GeomTolerance* - for geometric tolerances;
|
||||
* *XCAFDoc_Datum* - for geometric tolerance Datums.
|
||||
A GD&T type is identified by the attributes listed above, i.e. *XCAFDoc_DimTolTool* methods working with particular entity types check
|
||||
for presence of the corresponding attributes in passed labels. One can use methods of *XCAFDoc_DimTolTool* beginning with 'Is' for this purpose.
|
||||
|
||||
GD&T entities are stored in a child of the starting document label 0.1.4.
|
||||
Each GD&T entity then corresponds to the dedicated label, the property itself is one of access classes:
|
||||
* *XCAFDimTolObject_DimensionObject* - for dimensions;
|
||||
* *XCAFDimTolObject_GeomToleranceObject* - for geometric tolerances;
|
||||
* *XCAFDimTolObject_DatumObject* - for geometric tolerance Datums.
|
||||
|
||||
GD&Ts and Shapes are related to by Graph Nodes.
|
||||
|
||||
These definitions are common to various exchange formats, at least for STEP.
|
||||
|
||||
@subsubsection occt_xde_2_7_1 Initialization
|
||||
To query, edit, or initialize a Document to handle GD&Ts of XCAF, use:
|
||||
~~~~~
|
||||
Handle(XCAFDoc_DimTolTool) myDimTolTool =
|
||||
XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
|
||||
~~~~~
|
||||
This call can be used at any time. When it is used for the first time, a relevant structure is added to the document. This definition is used for all later GD&T calls and is not repeated for them.
|
||||
|
||||
@subsubsection occt_xde_2_7_2 Adding a GD&T
|
||||
*XCAFDoc_DimTolTool* provides methods to create GD&T 'empty' entities:
|
||||
* *AddDimension* - for a new dimension;
|
||||
* *AddGeomTolerance* - for a new geometric tolerance;
|
||||
* *AddDatum* - for a new geometric tolerance datum.
|
||||
|
||||
All methods create a sub-label for the corresponding GD&T entity of the tool master label and attach an attribute specific for the
|
||||
created entity.
|
||||
|
||||
Here is an example of adding a new dimension:
|
||||
~~~~~
|
||||
TDF_Label aDimLabel = myDimTolTool->AddDimension();
|
||||
if (!aDimLabel.IsNull())
|
||||
{
|
||||
// error processing
|
||||
}
|
||||
~~~~~
|
||||
A similar approach can be used for other GD&T types.
|
||||
|
||||
@subsubsection occt_xde_2_7_3 Editing a GD&T
|
||||
A newly added GD&T entity is empty. To set its data a corresponding access object should be used as it is demonstrated
|
||||
below, where the dimension becomes the linear distance between two points.
|
||||
~~~~~
|
||||
Handle(XCAFDoc_Dimension) aDimAttr;
|
||||
aDimLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimAttr);
|
||||
if (!aDimAttr.IsNull())
|
||||
{
|
||||
Handle(XCAFDimTolObjects_DimensionObject) aDimObject = aDimAttr->GetObject();
|
||||
// set dimension data
|
||||
aDimObject->SetType(XCAFDimTolObjects_DimensionType_Location_LinearDistance);
|
||||
aDimObject->SetPoint(thePnt1); // the first reference point
|
||||
aDimObject->SetPoint2(thePnt2); // the second reference point
|
||||
aDimObject->SetValue(theValue); // the distance value
|
||||
//...
|
||||
aDimAttr->SetObject(aDimObject);
|
||||
}
|
||||
~~~~~
|
||||
A similar approach can be used for other GD&T types.
|
||||
|
||||
@subsubsection occt_xde_2_7_4 Linking GD&Ts
|
||||
To link a GD&T entity with other OCAF labels (e.g. representing shapes) one should use the following methods:
|
||||
* *SetDimension* - for dimensions;
|
||||
* *SetGeomTolerance* - for geometric tolerances;
|
||||
* SetDatum - for geometric tolerance datums.
|
||||
|
||||
These methods can take a single label or a sequence of labels. All previous links will be removed.
|
||||
|
||||
The example below demonstrates linking of a dimension to sequences of shape labels:
|
||||
~~~~~
|
||||
TDF_LabelSequence aShapes1, aShapes2;
|
||||
aShapes1.Append(aShape11);
|
||||
//...
|
||||
aShapes2.Append(aShape21);
|
||||
//...
|
||||
aDGTTool->SetDimension(aShapes1, aShapes2, aDimLabel);
|
||||
~~~~~
|
||||
|
||||
In addition, a special method *SetDatumToGeomTol* should be used to link a datum with a geometric tolerance.
|
||||
|
||||
@subsubsection occt_xde_2_7_5 Finding GD&Ts and reference shapes
|
||||
|
||||
*XCAFDimTolObjects_Tool* class provides basic capabilities for searching GD&Ts linked to shapes.
|
||||
Using the tool one can get sequences of dimensions, geometric tolerances and datums linked with a shape. A series of related datums is also returned for geometric tolerances.
|
||||
|
||||
To get reference shapes for a GD&T entity one can use *GetRefShapeLabel* from *XCAFDoc_DimTolTool*.
|
||||
|
||||
*XCAFDoc_DimTolTool* provides methods to get lists of all dimensions, geometric tolerances and datums.
|
||||
|
||||
@subsubsection occt_xde_2_7_6 Storing custom data
|
||||
Every GD&T entity in XDE is represented as a label with attached attribute identifying entity type. All specific data is
|
||||
stored in sub-labels in standard OCAF attributes, such as *TDataStd_Integer*, *TDataStd_IntegerArray*, *TDataStd_RealArray* and so on.
|
||||
Sub-label tags are reserved for internal use and cannot be used for storing custom data. The following tag ranges are reserved for
|
||||
GD&T entities:
|
||||
* 1 - 17 - for dimensions;
|
||||
* 1 - 17 - for geometric tolerances;
|
||||
* 1 - 19 - for datums.
|
||||
Custom data can be stored in labels with tags beyond the ranges listed above.
|
||||
|
||||
@subsection occt_xde_2_8 Clipping planes
|
||||
|
||||
In an XDE document, Clipping planes are managed by the class *XCAFDoc_ClippingPlaneTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Clipping planes are stored in a child of the starting document label 0.1.8, where planes themselves are defined as *TDataXtd_Plane* attribute. *TDataStd_Name* attribute is used for naming.
|
||||
|
||||
To query, edit, or initialize a Document to handle clipping planes of XCAF, use:
|
||||
~~~~~
|
||||
Handle(XCAFDoc_ClippingPlaneTool) myClipPlaneTool =
|
||||
XCAFDoc_DocumentTool::ClippingPlaneTool(Doc->Main());
|
||||
~~~~~
|
||||
This call can be used at any time. When it is used for the first time, a relevant structure is added to the document.
|
||||
|
||||
To add a clipping plane use one of overloaded methods *AddClippingPlane*, e.g.:
|
||||
~~~~~
|
||||
gp_Pln aPln = ...
|
||||
Standard_Boolean aCapping = ...
|
||||
TDF_Label aClipPlnLbl = myClipPlaneTool->AddClippingPlane(aPln, "Name of plane", aCapping);
|
||||
if (aClipPlnLbl.IsNull())
|
||||
{
|
||||
// error processing
|
||||
}
|
||||
~~~~~
|
||||
|
||||
To remove a plane use *RemoveClippingPlane* method, e.g.:
|
||||
~~~~~
|
||||
if (!myClipPlaneTool->RemoveClippingPlane(aClipPlnLbl))
|
||||
{
|
||||
// not removed
|
||||
}
|
||||
~~~~~
|
||||
The plane will not be removed if it is referenced in at least one view.
|
||||
|
||||
To change clipping plane and its name use *UpdateClippingPlane* method, e.g.:
|
||||
~~~~~
|
||||
gp_Pln aPln = ...
|
||||
myClipPlaneTool->UpdateClippingPlane(aClipPlnLbl, aPln, "New name of plane");
|
||||
~~~~~
|
||||
|
||||
Capping property can be changed using *SetCapping* method, e.g.:
|
||||
~~~~~
|
||||
Standard_Boolean aCapping = ...
|
||||
myClipPlaneTool->SetCapping(aClipPlnLbl, aCapping);
|
||||
~~~~~
|
||||
|
||||
*XCAFDoc_ClippingPlaneTool* can be used to get all clipping plane labels and to check if a label belongs to the ClippingPlane table, e.g.:
|
||||
~~~~~
|
||||
TDF_LabelSequence aClipPlaneLbls;
|
||||
myClipPlaneTool->GetClippingPlanes(aClipPlaneLbls);
|
||||
...
|
||||
for (TDF_LabelSequence::Iterator anIt(aClipPlaneLbls); anIt.More(); anIt.Next())
|
||||
{
|
||||
if (myClipPlaneTool->IsClippingPlane(anIt.Value()))
|
||||
{
|
||||
// the label is a clipping plane
|
||||
gp_Pln aPln;
|
||||
TCollection_ExtendedString aName;
|
||||
Standard_Boolean aCapping;
|
||||
if (!myClipPlaneTool->GetClippingPlane(anIt.Value(), aPln, aName, aCapping))
|
||||
{
|
||||
// error processing
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@subsection occt_xde_2_9 Saved views
|
||||
|
||||
In an XDE document, Views are managed by the class *XCAFDoc_ViewTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Views are stored in a child of the starting document label 0.1.7, where a view itself is defined as *XCAFDoc_View* sub-class of *TDF_Attribute*. Views and selected shapes, clipping planes, GD&Ts and notes are related to by Graph Nodes.
|
||||
|
||||
To query, edit, or initialize a Document to handle views of XCAF, use:
|
||||
~~~~~
|
||||
Handle(XCAFDoc_ViewTool) myViewTool =
|
||||
XCAFDoc_DocumentTool::ViewTool(Doc->Main());
|
||||
~~~~~
|
||||
This call can be used at any time. When it is used for the first time, a relevant structure is added to the document.
|
||||
|
||||
To add a view use *AddView* method and an access *XCAFView_Object* object to set camera parameters, e.g.:
|
||||
~~~~~
|
||||
TDF_Label aViewLbl = myViewTool->AddView();
|
||||
if (aViewLbl.IsNull())
|
||||
{
|
||||
// error processing
|
||||
}
|
||||
Handle(XCAFDoc_View) aViewAttr;
|
||||
aViewLbl.FindAttribute(XCAFDoc_View::GetID(), aViewAttr);
|
||||
if (!aViewAttr.IsNull())
|
||||
{
|
||||
Handle(XCAFView_Object) aViewObject = aViewAttr->GetObject();
|
||||
// set view data
|
||||
aViewObject->SetType(XCAFView_ProjectionType_Parallel);
|
||||
aViewObject->SetViewDirection(theViewDir);
|
||||
aViewObject->SetZoomFactor(2.0);
|
||||
...
|
||||
aViewAttr->SetObject(aViewObject);
|
||||
}
|
||||
~~~~~
|
||||
|
||||
To set shapes, clipping planes, GD&Ts and notes selected for the view use one of overloaded *SetView* methods of *XCAFDoc_ViewTool*.
|
||||
To set only clipping planes one should use *SetClippingPlanes* method.
|
||||
~~~~~
|
||||
TDF_LabelSequence aShapes; ...
|
||||
TDF_LabelSequence aGDTs; ...
|
||||
myViewTool->SetView(aShapes, aGDTs, aViewLbl);
|
||||
TDF_LabelSequence aClippingPlanes; ...
|
||||
myViewTool->SetClippingPlanes(aClippingPlanes, aViewLbl);
|
||||
~~~~~
|
||||
|
||||
To remove a view use *RemoveView* method.
|
||||
|
||||
To get all view labels and check if a label belongs to the View table use:
|
||||
~~~~~
|
||||
TDF_LabelSequence aViewLbls;
|
||||
myViewTool->GetViewLabels(aViewLbls);
|
||||
...
|
||||
for (TDF_LabelSequence::Iterator anIt(aViewLbls); anIt.More(); anIt.Next())
|
||||
{
|
||||
if (myViewTool->IsView(anIt.Value()))
|
||||
{
|
||||
// the label is a view
|
||||
...
|
||||
}
|
||||
}
|
||||
~~~~~
|
||||
|
||||
To get shapes, clipping planes, GD&Ts or notes associated with a particular view use the following methods:
|
||||
* *GetRefShapeLabel* - returns a sequence of associated shape labels;
|
||||
* *GetRefGDTLabel* - returns a sequence of associated GDT labels;
|
||||
* *GetRefClippingPlaneLabel* - returns a sequence of associated clipping plane labels;
|
||||
* *GetRefNoteLabel* - returns a sequence of associated note labels;
|
||||
* *GetRefAnnotationLabel* - returns a sequence of associated annotated labels.
|
||||
|
||||
And vice versa, to get views that display a particular clipping plane, GD&T or note use the following methods:
|
||||
* *GetViewLabelsForShape* - returns a sequence of associated view labels for a shape;
|
||||
* *GetViewLabelsForGDT* - returns a sequence of associated view labels for a GD&T;
|
||||
* *GetViewLabelsForClippingPlane* - returns a sequence of associated view labels for a clipping plane;
|
||||
* *GetViewLabelsForNote* - returns a sequence of associated view labels for a note;
|
||||
* *GetViewLabelsForAnnotation* - returns a sequence of associated view labels for an annotated label.
|
||||
|
||||
@subsection occt_xde_2_10 Custom notes
|
||||
|
||||
In an XDE document, custom notes are managed by the class *XCAFDoc_NotesTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The Property itself is defined as sub-class of *XCAFDoc_Note* abstract class, which is a sub-class of *TDF_Attribute* one.
|
||||
|
||||
Custom notes are stored in a child of the *XCAFDoc_NotesTool* label, at label 0.1.9.1. Each note then corresponds to a dedicated label. A note may be attached to a document item identified by a label, a sub-shape identified by integer index or an attribute identified by GUID. Annotations are stored in a child of the *XCAFDoc_NotesTool* label, at label 0.1.9.2.
|
||||
Custom notes are stored in a child of the *XCAFDoc_NotesTool* label: it is at label 0.1.9.1. Each note then corresponds to a dedicated label. A note may be attached to a document item identified by a label, a sub-shape identified by integer index or an attribute identified by GUID. Annotations are stored in a child of the *XCAFDoc_NotesTool* label: it is at label 0.1.9.2.
|
||||
Notes binding is done through *XCAFDoc_GraphNode* attribute.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_notes001.png,"Structure of notes part of XCAF document",240}
|
||||
|
||||
@subsubsection occt_xde_2_10_1 Initialization
|
||||
@subsubsection occt_xde_2_7_1 Initialization
|
||||
|
||||
To query, edit, or initialize a Document to handle custom notes of XCAF, use:
|
||||
~~~~~
|
||||
Handle(XCAFDoc_NotesTool) myNotes =
|
||||
XCAFDoc_DocumentTool::NotesTool(Doc->Main ());
|
||||
~~~~~
|
||||
This call can be used at any time. The first time it is used, a relevant structure is added to the document. This definition is used for all later notes calls and will not be repeated for them.
|
||||
This call can be used at any time. The first time it is used, a relevant structure is added to the document. This definition is used for all the following notes calls and will not be repeated for these.
|
||||
|
||||
@subsubsection occt_xde_2_10_2 Creating Notes
|
||||
@subsubsection occt_xde_2_7_2 Creating Notes
|
||||
|
||||
Before annotating a Document item a note must be created using one of the following methods of *XCAFDoc_NotesTool* class:
|
||||
- *CreateComment* : creates a note with a textual comment;
|
||||
- *CreateBinData* : creates a note with arbitrary binary data, e.g. contents of a file.
|
||||
- CreateComment : creates a note with a textual comment
|
||||
- CreateBinData : creates a note with arbitrary binary data, e.g. contents of a file
|
||||
|
||||
Both methods return an instance of *XCAFDoc_Note* class.
|
||||
~~~~~
|
||||
@@ -936,13 +658,13 @@ Handle(XCAFDoc_Note) myNote = myNotes->CreateComment("User", "Timestamp", "Hello
|
||||
~~~~~
|
||||
This code adds a child label to label 0.1.9.1 with *XCAFDoc_NoteComment* attribute.
|
||||
|
||||
@subsubsection occt_xde_2_10_3 Editing a Note
|
||||
@subsubsection occt_xde_2_7_3 Editing a Note
|
||||
An instance of *XCAFDoc_Note* class can be used for note editing.
|
||||
One may change common note data.
|
||||
~~~~~
|
||||
myNote->Set("New User", "New Timestamp");
|
||||
~~~~~
|
||||
To change specific data one needs to down cast *myNote* handle to the appropriate sub-class:
|
||||
To change specific data one need to down cast *myNote* handle to the appropriate sub-class:
|
||||
~~~~~
|
||||
Handle(XCAFDoc_NoteComment) myCommentNote = Handle(XCAFDoc_NoteComment)::DownCast(myNote);
|
||||
if (!myCommentNote.IsNull()) {
|
||||
@@ -950,12 +672,12 @@ if (!myCommentNote.IsNull()) {
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_xde_2_10_4 Adding Notes
|
||||
@subsubsection occt_xde_2_7_4 Adding Notes
|
||||
|
||||
Once a note has been created it can be bound to a Document item using the following *XCAFDoc_NotesTool* methods:
|
||||
- *AddNote* : binds a note to a label;
|
||||
- *AddNoteToAttr* : binds a note to a label's attribute;
|
||||
- *AddNoteToSubshape* : binds a note to a sub-shape.
|
||||
- AddNote : binds a note to a label
|
||||
- AddNoteToAttr : binds a note to a label's attribute
|
||||
- AddNoteToSubshape : binds a note to a sub-shape
|
||||
|
||||
All methods return a pointer to *XCAFDoc_AssemblyItemRef* attribute identifying the annotated item.
|
||||
~~~~~
|
||||
@@ -968,14 +690,14 @@ Handle(XCAFDoc_AssemblyItemRef) myRefAttr = myNotes->AddNoteToAttr(myNote->Label
|
||||
Standard_Integer theSubshape = 1;
|
||||
Handle(XCAFDoc_AssemblyItemRef) myRefSubshape = myNotes->AddNoteToSubshape(myNote->Label(), theSubshape);
|
||||
~~~~~
|
||||
This code adds three child labels with *XCAFDoc_AssemblyItemRef* attribute to label 0.1.9.2. *XCAFDoc_GraphNode* attributes are added to the child labels and note labels.
|
||||
This code adds three child labels to label 0.1.9.2 with *XCAFDoc_AssemblyItemRef* attribute with *XCAFDoc_GraphNode* attributes added to this and note labels.
|
||||
|
||||
@subsubsection occt_xde_2_10_5 Finding Notes
|
||||
@subsubsection occt_xde_2_7_5 Finding Notes
|
||||
|
||||
To find annotation labels under label 0.1.9.2 use the following *XCAFDoc_NotesTool* methods:
|
||||
- *FindAnnotatedItem* : returns an annotation label for a label;
|
||||
- *FindAnnotatedItemAttr* : returns an annotation label for a label's attribute;
|
||||
- *FindAnnotatedItemSubshape* : returns an annotation label for a sub-shape.
|
||||
- FindAnnotatedItem : returns an annotation label for a label
|
||||
- FindAnnotatedItemAttr : returns an annotation label for a label's attribute
|
||||
- FindAnnotatedItemSubshape : returns an annotation label for a sub-shape
|
||||
|
||||
~~~~~
|
||||
Handle(XCAFDoc_NotesTool) myNotes = ...
|
||||
@@ -989,9 +711,9 @@ TDF_Label myLabelSubshape = myNotes->FindAnnotatedItemSubshape(theLabel, theSubs
|
||||
Null label will be returned if there is no corresponding annotation.
|
||||
|
||||
To get all notes of the Document item use the following *XCAFDoc_NotesTool* methods:
|
||||
- *GetNotes* : outputs a sequence of note labels bound to a label;
|
||||
- *GetAttrNotes* : outputs a sequence of note labels bound to a label's attribute;
|
||||
- *GetAttrSubshape* : outputs a sequence of note labels bound to a sub-shape.
|
||||
- GetNotes : outputs a sequence of note labels bound to a label
|
||||
- GetAttrNotes : outputs a sequence of note labels bound to a label's attribute
|
||||
- GetAttrSubshape : outputs a sequence of note labels bound to a sub-shape
|
||||
|
||||
All these methods return the number of notes.
|
||||
~~~~~
|
||||
@@ -1007,12 +729,12 @@ TDF_LabelSequence theNotesSubshape;
|
||||
myNotes->GetAttrSubshape(theLabel, theSubshape, theNotesSubshape);
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_xde_2_10_6 Removing Notes
|
||||
@subsubsection occt_xde_2_7_6 Removing Notes
|
||||
|
||||
To remove a note use one of the following *XCAFDoc_NotesTool* methods:
|
||||
- *RemoveNote* : unbinds a note from a label;
|
||||
- *RemoveAttrNote* : unbinds a note from a label's attribute;
|
||||
- *RemoveSubshapeNote* : unbinds a note from a sub-shape.
|
||||
- RemoveNote : unbinds a note from a label
|
||||
- RemoveAttrNote : unbinds a note from a label's attribute
|
||||
- RemoveSubshapeNote : unbinds a note from a sub-shape
|
||||
|
||||
~~~~~
|
||||
Handle(XCAFDoc_Note) myNote = ...
|
||||
@@ -1024,31 +746,30 @@ Standard_Integer theSubshape = 1;
|
||||
myNotes->RemoveSubshapeNote(myNote->Label(), theSubshape);
|
||||
~~~~~
|
||||
A note will not be deleted automatically.
|
||||
Counterpart methods to remove all notes are available, too.
|
||||
Counterpart methods to remove all notes are available too.
|
||||
|
||||
@subsubsection occt_xde_2_10_7 Deleting Notes
|
||||
@subsubsection occt_xde_2_7_7 Deleting Notes
|
||||
|
||||
To delete note(s) use the following *XCAFDoc_NotesTool* methods:
|
||||
- *DeleteNote* : deletes a single note;
|
||||
- *DeleteNotes* : deletes a sequence of notes;
|
||||
- *DeleteAllNotes* : deletes all Document notes;
|
||||
- *DeleteOrphanNotes* : deletes notes not bound to Document items.
|
||||
- DeleteNote : deletes a single note
|
||||
- DeleteNotes : deletes a sequence of notes
|
||||
- DeleteAllNotes : deletes all Document notes
|
||||
- DeleteOrphanNotes : deletes notes not bound to Document items
|
||||
|
||||
All these methods except for the last one break all links with Document items as well.
|
||||
All these methods excepting the last one break all links with Document items as well.
|
||||
|
||||
@subsection occt_xde_2_11 Reading and Writing STEP or IGES
|
||||
@subsection occt_xde_2_8 Reading and Writing STEP or IGES
|
||||
Note that saving and restoring the document itself are standard OCAF operations. As the various previously described definitions enter into this frame, they will not be explained any further.
|
||||
The same can be said for Viewing: presentations can be defined from Shapes and Colors.
|
||||
|
||||
There are several important points to consider:
|
||||
* Previously defined Readers and Writers for dealing with Shapes only, whether Standard or Advanced, remain unchanged in their form and in their dependencies. In addition, functions other than mapping are also unchanged.
|
||||
* XDE provides mapping with data other than Shapes. Names, Colors, Layers, GD&T, Clipping planes, Views, Validation Properties (Centroid, Volume, Area), and Assembly Structure are hierarchic with rigid motion. Currently, Clipping planes and Views writing supported for XBF format only.
|
||||
* XDE provides mapping with data other than Shapes. Names, Colors, Layers, Validation Properties (Centroid, Volume, Area), and Assembly Structure are hierarchic with rigid motion.
|
||||
* XDE mapping is relevant for use within the Advanced level of Data Exchanges, rather than Standard ones, because a higher level of information is better suited to a higher quality of shapes. In addition, this allows to avoid the multiplicity of combinations between various options. Note that this choice is not one of architecture but of practical usage and packaging.
|
||||
* Reader and Writer classes for XDE are generally used like those for Shapes. However, their use is adapted to manage a Document rather than a Shape.
|
||||
|
||||
The packages to manage this are *IGESCAFControl* for IGES, and *STEPCAFControl* for STEP.
|
||||
|
||||
@subsubsection occt_xde_2_11_1 Reading a STEP file
|
||||
@subsubsection occt_xde_2_8_1 Reading a STEP file
|
||||
To read a STEP file by itself, use:
|
||||
|
||||
~~~~~
|
||||
@@ -1069,7 +790,7 @@ if ( !reader.Transfer ( doc ) ) {
|
||||
~~~~~
|
||||
|
||||
In addition, the reader provides methods that are applicable to document transfers and for directly querying of the data produced.
|
||||
@subsubsection occt_xde_2_11_2 Writing a STEP file
|
||||
@subsubsection occt_xde_2_8_2 Writing a STEP file
|
||||
To write a STEP file by itself, use:
|
||||
|
||||
~~~~~
|
||||
@@ -1090,19 +811,18 @@ if ( ! writer.Transfer ( Doc, mode ) ) {
|
||||
IFSelect_ReturnStatus stat = writer.Write(file-name);
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_xde_2_11_3 Reading an IGES File
|
||||
@subsubsection occt_xde_2_8_3 Reading an IGES File
|
||||
Use the same procedure as for a STEP file but with IGESCAFControl instead of STEPCAFControl.
|
||||
@subsubsection occt_xde_2_11_4 Writing an IGES File
|
||||
@subsubsection occt_xde_2_8_4 Writing an IGES File
|
||||
Use the same procedure as for a STEP file but with IGESCAFControl instead of STEPCAFControl.
|
||||
|
||||
@subsection occt_xde_2_12 Using an XDE Document
|
||||
@subsection occt_xde_2_9 Using an XDE Document
|
||||
There are several ways of exploiting XDE data from an application, you can:
|
||||
1. Get the data relevant for the application by mapping XDE/Appli, then discard the XDE data once it has been used.
|
||||
2. Create a reference from the Application Document to the XDE Document, to have its data available as external data.
|
||||
3. Embed XDE data inside the Application Document (see the following section for details).
|
||||
4. Directly exploit XDE data such as when using file checkers.
|
||||
|
||||
@subsubsection occt_xde_2_12_1 XDE Data inside an Application Document
|
||||
@subsubsection occt_xde_2_91 XDE Data inside an Application Document
|
||||
To have XCAF data elsewhere than under label 0.1, you use the DocLabel of XDE. The method DocLabel from XCAFDoc_DocumentTool determines the relevant Label for XCAF. However, note that the default is 0.1.
|
||||
|
||||
In addition, as XDE data is defined and managed in a modular way, you can consider exclusively Assembly Structure, only Colors, and so on.
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#include <d3d9.h>
|
||||
#include <windows.h>
|
||||
|
||||
// include required OCCT headers
|
||||
@@ -620,7 +619,7 @@ public:
|
||||
}
|
||||
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
|
||||
{
|
||||
myAISContext()->SetTransparency (myAISContext()->SelectedInteractive(), ((Standard_Real )theTrans) / 10.0, Standard_False);
|
||||
myAISContext()->SetTransparency (myAISContext()->Current(), ((Standard_Real )theTrans) / 10.0, Standard_False);
|
||||
}
|
||||
myAISContext()->UpdateCurrentViewer();
|
||||
}
|
||||
|
@@ -3,24 +3,19 @@
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "custom.sh" ]; then
|
||||
source "custom.sh" $*;
|
||||
source "custom.sh";
|
||||
fi
|
||||
|
||||
if [ -e "${aSamplePath}/../../../env.sh" ]; then
|
||||
source "${aSamplePath}/../../../env.sh" $*;
|
||||
source "${aSamplePath}/../../../env.sh";
|
||||
fi
|
||||
|
||||
if [ "${QTDIR}" != "" ]; then
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
else
|
||||
aQMakePath=`which qmake`
|
||||
echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
|
||||
if [ -x "$aQMakePath" ]; then
|
||||
echo "qmake from PATH will be used instead."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
if test "${QTDIR}" == ""; then
|
||||
echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
host=`uname -s`
|
||||
export STATION=$host
|
||||
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
qmake FuncDemo.pro
|
||||
if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
|
||||
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
|
||||
if [ "${CASDEB}" == "d" ]; then
|
||||
make -j $aNbJobs debug
|
||||
make debug
|
||||
else
|
||||
make -j $aNbJobs release
|
||||
make release
|
||||
fi
|
||||
fi
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
|
||||
aSystem=`uname -s`
|
||||
|
@@ -3,25 +3,20 @@
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "custom.sh" ]; then
|
||||
source "custom.sh" $*;
|
||||
source "custom.sh";
|
||||
fi
|
||||
|
||||
if [ -e "${aSamplePath}/../../../env.sh" ]; then
|
||||
source "${aSamplePath}/../../../env.sh" $*;
|
||||
source "${aSamplePath}/../../../env.sh";
|
||||
fi
|
||||
|
||||
if [ "${QTDIR}" != "" ]; then
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
else
|
||||
aQMakePath=`which qmake`
|
||||
echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
|
||||
if [ -x "$aQMakePath" ]; then
|
||||
echo "qmake from PATH will be used instead."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
if test "${QTDIR}" == ""; then
|
||||
echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
host=`uname -s`
|
||||
export STATION=$host
|
||||
export RES_DIR=${aSamplePath}/${STATION}/res
|
||||
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
qmake IESample.pro
|
||||
if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
|
||||
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
|
||||
if [ "${CASDEB}" == "d" ]; then
|
||||
make -j $aNbJobs debug
|
||||
make debug
|
||||
else
|
||||
make -j $aNbJobs release
|
||||
make release
|
||||
fi
|
||||
fi
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
|
||||
aSystem=`uname -s`
|
||||
|
@@ -3,25 +3,20 @@
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "custom.sh" ]; then
|
||||
source "custom.sh" $*;
|
||||
source "custom.sh";
|
||||
fi
|
||||
|
||||
if [ -e "${aSamplePath}/../../../env.sh" ]; then
|
||||
source "${aSamplePath}/../../../env.sh" $*;
|
||||
source "${aSamplePath}/../../../env.sh";
|
||||
fi
|
||||
|
||||
if [ "${QTDIR}" != "" ]; then
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
else
|
||||
aQMakePath=`which qmake`
|
||||
echo "Environment variable \"QTDIR\" not defined.. Define it in \"custom.sh\" script."
|
||||
if [ -x "$aQMakePath" ]; then
|
||||
echo "qmake from PATH will be used instead."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
if test "${QTDIR}" == ""; then
|
||||
echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
host=`uname -s`
|
||||
export STATION=$host
|
||||
export RES_DIR=${aSamplePath}/${STATION}/res
|
||||
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
qmake Tutorial.pro
|
||||
if [ "$(uname -s)" != "Darwin" ] || [ "$MACOSX_USE_GLX" == "true" ]; then
|
||||
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
|
||||
if [ "${CASDEB}" == "d" ]; then
|
||||
make -j $aNbJobs debug
|
||||
make debug
|
||||
else
|
||||
make -j $aNbJobs release
|
||||
make release
|
||||
fi
|
||||
fi
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
|
||||
aSystem=`uname -s`
|
||||
|
@@ -59,7 +59,7 @@ vdimension ad_1 -angle -shapes as_38 as_49 -color black
|
||||
vdimension ad_2 -angle -shapes bs_24 bs_25 -color black
|
||||
vdimension ad_3 -angle -shapes as_48 as_43 -color black
|
||||
|
||||
puts "Changing text and arrow parameters of dimensions..."
|
||||
puts "Changing text and arrow paramaters of dimensions..."
|
||||
foreach i $aList {
|
||||
vdimparam $i -text 3d sh 6 -arrowlength 4 -arrowangle $anArrAngle
|
||||
}
|
||||
|
@@ -495,9 +495,9 @@ void AIS_ColoredShape::ComputeSelection (const Handle(SelectMgr_Selection)& theS
|
||||
aTypOfSel, aPriority, aDeflection, aDeviationAngle);
|
||||
|
||||
Handle(SelectMgr_SelectableObject) aThis (this);
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
for (theSelection->Init(); theSelection->More(); theSelection->Next())
|
||||
{
|
||||
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aSelEntIter.Value()->BaseSensitive()->OwnerId());
|
||||
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (theSelection->Sensitive()->BaseSensitive()->OwnerId());
|
||||
anOwner->Set (aThis);
|
||||
}
|
||||
|
||||
|
@@ -164,10 +164,54 @@ void AIS_ConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_ConnectedInteractive::Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Handle(Prs3d_Presentation)& thePresentation,
|
||||
const TopoDS_Shape& theShape)
|
||||
{
|
||||
AIS_Shape::computeHlrPresentation (theProjector, thePrs, theShape, myDrawer);
|
||||
if (myShape.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (theShape.ShapeType())
|
||||
{
|
||||
case TopAbs_VERTEX:
|
||||
case TopAbs_EDGE:
|
||||
case TopAbs_WIRE:
|
||||
{
|
||||
thePresentation->SetDisplayPriority (4);
|
||||
StdPrs_WFShape::Add (thePresentation, theShape, myDrawer);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Handle(Prs3d_Drawer) aDefaultDrawer = GetContext()->DefaultDrawer();
|
||||
if (aDefaultDrawer->DrawHiddenLine())
|
||||
{
|
||||
myDrawer->EnableDrawHiddenLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->DisableDrawHiddenLine();
|
||||
}
|
||||
|
||||
Aspect_TypeOfDeflection aPrevDeflection = aDefaultDrawer->TypeOfDeflection();
|
||||
aDefaultDrawer->SetTypeOfDeflection(Aspect_TOD_RELATIVE);
|
||||
|
||||
// process HLRAngle and HLRDeviationCoefficient()
|
||||
Standard_Real aPrevAngle = myDrawer->HLRAngle();
|
||||
Standard_Real aNewAngle = aDefaultDrawer->HLRAngle();
|
||||
if (myDrawer->IsAutoTriangulation() &&
|
||||
Abs (aNewAngle - aPrevAngle) > Precision::Angular())
|
||||
{
|
||||
BRepTools::Clean (theShape);
|
||||
}
|
||||
|
||||
myDrawer->SetHLRAngle (aNewAngle);
|
||||
myDrawer->SetHLRDeviationCoefficient (aDefaultDrawer->HLRDeviationCoefficient());
|
||||
StdPrs_HLRPolyShape::Add (thePresentation, theShape, myDrawer, theProjector);
|
||||
aDefaultDrawer->SetTypeOfDeflection (aPrevDeflection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -233,9 +277,9 @@ void AIS_ConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selectio
|
||||
myReference->RecomputePrimitives (theMode);
|
||||
}
|
||||
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (TheRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
for (TheRefSel->Init(); TheRefSel->More(); TheRefSel->Next())
|
||||
{
|
||||
aSensitive = Handle(Select3D_SensitiveEntity)::DownCast (aSelEntIter.Value()->BaseSensitive());
|
||||
aSensitive = Handle(Select3D_SensitiveEntity)::DownCast (TheRefSel->Sensitive()->BaseSensitive());
|
||||
if (!aSensitive.IsNull())
|
||||
{
|
||||
// Get the copy of SE3D
|
||||
@@ -260,28 +304,38 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
|
||||
Shapes2EntitiesMap;
|
||||
|
||||
if (!myReference->HasSelection (theMode))
|
||||
{
|
||||
myReference->RecomputePrimitives (theMode);
|
||||
}
|
||||
|
||||
|
||||
const Handle(SelectMgr_Selection)& aRefSel = myReference->Selection (theMode);
|
||||
|
||||
if (aRefSel->IsEmpty() || aRefSel->UpdateStatus() == SelectMgr_TOU_Full)
|
||||
{
|
||||
myReference->RecomputePrimitives (theMode);
|
||||
}
|
||||
|
||||
Handle(StdSelect_BRepOwner) anOwner;
|
||||
TopLoc_Location aDummyLoc;
|
||||
|
||||
// Fill in the map of subshapes and corresponding sensitive entities associated with aMode
|
||||
Handle(Select3D_SensitiveEntity) aSE, aNewSE;
|
||||
Shapes2EntitiesMap aShapes2EntitiesMap;
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (aRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
|
||||
SensitiveList aSEList;
|
||||
TopoDS_Shape aSubShape;
|
||||
|
||||
// Fill in the map of subshapes and corresponding
|
||||
// sensitive entities associated with aMode
|
||||
for (aRefSel->Init(); aRefSel->More(); aRefSel->Next())
|
||||
{
|
||||
if (Handle(Select3D_SensitiveEntity) aSE = Handle(Select3D_SensitiveEntity)::DownCast (aSelEntIter.Value()->BaseSensitive()))
|
||||
aSE = Handle(Select3D_SensitiveEntity)::DownCast (aRefSel->Sensitive()->BaseSensitive());
|
||||
if(!aSE.IsNull())
|
||||
{
|
||||
if (Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast (aSE->OwnerId()))
|
||||
anOwner = Handle(StdSelect_BRepOwner)::DownCast (aSE->OwnerId());
|
||||
if(!anOwner.IsNull())
|
||||
{
|
||||
const TopoDS_Shape& aSubShape = anOwner->Shape();
|
||||
aSubShape = anOwner->Shape();
|
||||
if(!aShapes2EntitiesMap.IsBound (aSubShape))
|
||||
{
|
||||
aShapes2EntitiesMap.Bind (aSubShape, SensitiveList());
|
||||
aShapes2EntitiesMap.Bind (aSubShape, aSEList);
|
||||
}
|
||||
aShapes2EntitiesMap (aSubShape).Append (aSE);
|
||||
}
|
||||
@@ -291,14 +345,20 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
|
||||
// Fill in selection from aShapes2EntitiesMap
|
||||
for (Shapes2EntitiesMap::Iterator aMapIt (aShapes2EntitiesMap); aMapIt.More(); aMapIt.Next())
|
||||
{
|
||||
const SensitiveList& aSEList = aMapIt.Value();
|
||||
Handle(StdSelect_BRepOwner) anOwner = new StdSelect_BRepOwner (aMapIt.Key(), this, aSEList.First()->OwnerId()->Priority(), Standard_True);
|
||||
aSEList = aMapIt.Value();
|
||||
anOwner = new StdSelect_BRepOwner (aMapIt.Key(),
|
||||
this,
|
||||
aSEList.First()->OwnerId()->Priority(),
|
||||
Standard_True);
|
||||
anOwner->SetLocation (Transformation());
|
||||
|
||||
for (SensitiveList::Iterator aListIt (aSEList); aListIt.More(); aListIt.Next())
|
||||
{
|
||||
Handle(Select3D_SensitiveEntity) aSE = aListIt.Value();
|
||||
Handle(Select3D_SensitiveEntity) aNewSE = aSE->GetConnected();
|
||||
aSE = aListIt.Value();
|
||||
|
||||
aNewSE = aSE->GetConnected();
|
||||
aNewSE->Set (anOwner);
|
||||
|
||||
theSelection->Add (aNewSE);
|
||||
}
|
||||
}
|
||||
|
@@ -639,8 +639,8 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
|
||||
curpos.Translate(offset);
|
||||
Position = curpos;
|
||||
}
|
||||
else {
|
||||
gp_Dir aDir = Plane->Pln().Axis().Direction();
|
||||
else {
|
||||
const gp_Dir& aDir = Plane->Pln().Axis().Direction();
|
||||
gp_Vec aVec (aDir.XYZ()*10*ArrowSize);
|
||||
//Position = gp_Pnt(FirstAttach.XYZ()+gp_XYZ(1.,1.,1.)); // not correct
|
||||
Position = FirstAttach.Translated(aVec);
|
||||
|
@@ -186,11 +186,11 @@ AIS_InteractiveContext::~AIS_InteractiveContext()
|
||||
Handle(AIS_InteractiveContext) aNullContext;
|
||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObj = anObjIter.Key();
|
||||
Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
|
||||
anObj->SetContext (aNullContext);
|
||||
for (SelectMgr_SequenceOfSelection::Iterator aSelIter (anObj->Selections()); aSelIter.More(); aSelIter.Next())
|
||||
for (anObj->Init(); anObj->More(); anObj->Next())
|
||||
{
|
||||
aSelIter.Value()->UpdateBVHStatus (SelectMgr_TBU_Renew);
|
||||
anObj->CurrentSelection()->UpdateBVHStatus (SelectMgr_TBU_Renew);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,13 +692,15 @@ void AIS_InteractiveContext::DisplaySelected (const Standard_Boolean theToUpdate
|
||||
return;
|
||||
}
|
||||
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
for (mySelection->Init(); mySelection->More(); mySelection->Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter.Value()->Selectable());
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (mySelection->Value()->Selectable());
|
||||
Display (anObj, Standard_False);
|
||||
isFound = Standard_True;
|
||||
}
|
||||
|
||||
if (theToUpdateViewer && !mySelection->Objects().IsEmpty())
|
||||
if (isFound && theToUpdateViewer)
|
||||
{
|
||||
myMainVwr->Update();
|
||||
}
|
||||
@@ -715,12 +717,17 @@ void AIS_InteractiveContext::EraseSelected (const Standard_Boolean theToUpdateVi
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Init (mySelection->Objects()))
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
mySelection->Init();
|
||||
while (mySelection->More())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter.Value()->Selectable());
|
||||
Handle(SelectMgr_EntityOwner) anOwner = mySelection->Value();
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
|
||||
Erase (anObj, Standard_False);
|
||||
isFound = Standard_True;
|
||||
|
||||
mySelection->Init();
|
||||
}
|
||||
|
||||
if (isFound && theToUpdateViewer)
|
||||
@@ -2851,14 +2858,15 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
|
||||
const Standard_Real theMargin,
|
||||
const Standard_Boolean theToUpdate)
|
||||
{
|
||||
const Handle(AIS_Selection)& aSelection = HasOpenedContext()
|
||||
? myLocalContexts(myCurLocalIndex)->Selection()
|
||||
: mySelection;
|
||||
const Handle(AIS_Selection)& aSelection = HasOpenedContext() ?
|
||||
myLocalContexts(myCurLocalIndex)->Selection() : mySelection;
|
||||
|
||||
Bnd_Box aBndSelected;
|
||||
|
||||
AIS_MapOfObjectOwners anObjectOwnerMap;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (aSelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
for (aSelection->Init(); aSelection->More(); aSelection->Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
|
||||
const Handle(SelectMgr_EntityOwner)& anOwner = aSelection->Value();
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
|
||||
if (anObj->IsInfinite())
|
||||
{
|
||||
|
@@ -564,9 +564,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdate
|
||||
clearDynamicHighlight();
|
||||
if (myWasLastMain && !myLastinMain.IsNull())
|
||||
{
|
||||
if (!myLastinMain->IsSelected()
|
||||
|| myLastinMain->IsForcedHilight()
|
||||
|| NbSelected() > 1)
|
||||
if (!myLastinMain->IsSelected() || myLastinMain->IsForcedHilight())
|
||||
{
|
||||
SetSelected (myLastinMain, Standard_False);
|
||||
if(toUpdateViewer)
|
||||
@@ -1015,7 +1013,10 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
{
|
||||
Display (theObject, Standard_False);
|
||||
}
|
||||
|
||||
if (!theObject->HasSelection (theObject->GlobalSelectionMode()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Handle(SelectMgr_EntityOwner) anOwner = theObject->GlobalSelOwner();
|
||||
if (anOwner.IsNull())
|
||||
{
|
||||
@@ -1036,9 +1037,9 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
return;
|
||||
}
|
||||
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
for (mySelection->Init(); mySelection->More(); mySelection->Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner)& aSelOwner = aSelIter.Value();
|
||||
const Handle(SelectMgr_EntityOwner) aSelOwner = mySelection->Value();
|
||||
if (!myFilters->IsOk (aSelOwner))
|
||||
{
|
||||
continue;
|
||||
@@ -1136,26 +1137,22 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveOb
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
if (theObject.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasOpenedContext())
|
||||
{
|
||||
return myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (theObject, theToUpdateViewer);
|
||||
}
|
||||
|
||||
if (!myObjects.IsBound (theObject))
|
||||
{
|
||||
const Standard_Integer aGlobalSelMode = theObject->GlobalSelectionMode();
|
||||
if (!myObjects.IsBound (theObject) || !theObject->HasSelection (aGlobalSelMode))
|
||||
return;
|
||||
}
|
||||
|
||||
setContextToObject (theObject);
|
||||
const Handle(SelectMgr_EntityOwner) anOwner = theObject->GlobalSelOwner();
|
||||
if (!anOwner.IsNull()
|
||||
&& anOwner->HasSelectable())
|
||||
{
|
||||
AddOrRemoveSelected (anOwner, theToUpdateViewer);
|
||||
}
|
||||
|
||||
if (anOwner.IsNull() || !anOwner->HasSelectable())
|
||||
return;
|
||||
|
||||
AddOrRemoveSelected (anOwner, theToUpdateViewer);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AddOrRemoveSelected
|
||||
@@ -1196,7 +1193,8 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
|
||||
AIS_SelectStatus aSelStat = mySelection->Select (theOwner);
|
||||
theOwner->SetSelected (aSelStat == AIS_SS_Added);
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
const Handle(AIS_InteractiveObject) anObj =
|
||||
Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
|
||||
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
|
||||
if (theOwner->IsSelected())
|
||||
@@ -1241,18 +1239,19 @@ Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_Interactiv
|
||||
|
||||
const Standard_Integer aGlobalSelMode = theObj->GlobalSelectionMode();
|
||||
const TColStd_ListOfInteger& anActivatedModes = myObjects (theObj)->SelectionModes();
|
||||
Standard_Boolean isGlobalModeActivated = Standard_False;
|
||||
for (TColStd_ListIteratorOfListOfInteger aModeIter (anActivatedModes); aModeIter.More(); aModeIter.Next())
|
||||
{
|
||||
if (aModeIter.Value() == aGlobalSelMode)
|
||||
{
|
||||
if (Handle(SelectMgr_EntityOwner) aGlobOwner = theObj->GlobalSelOwner())
|
||||
{
|
||||
return aGlobOwner->IsSelected();
|
||||
}
|
||||
return Standard_False;
|
||||
isGlobalModeActivated = Standard_True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated || theObj->GlobalSelOwner().IsNull())
|
||||
return Standard_False;
|
||||
|
||||
return theObj->GlobalSelOwner()->IsSelected();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1262,11 +1261,12 @@ Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_Interactiv
|
||||
Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(SelectMgr_EntityOwner)& theOwner) const
|
||||
{
|
||||
if (HasOpenedContext())
|
||||
{
|
||||
return myLocalContexts(myCurLocalIndex)->IsSelected (theOwner);
|
||||
}
|
||||
return !theOwner.IsNull()
|
||||
&& theOwner->IsSelected();
|
||||
|
||||
if (theOwner.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
return theOwner->IsSelected();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1390,44 +1390,37 @@ void AIS_InteractiveContext::EntityOwners(Handle(SelectMgr_IndexedMapOfOwner)& t
|
||||
const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Standard_Integer theMode) const
|
||||
{
|
||||
if (theIObj.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( theIObj.IsNull() )
|
||||
return;
|
||||
|
||||
TColStd_ListOfInteger aModes;
|
||||
if (theMode == -1)
|
||||
{
|
||||
ActivatedModes (theIObj, aModes);
|
||||
}
|
||||
if ( theMode == -1 )
|
||||
ActivatedModes( theIObj, aModes );
|
||||
else
|
||||
{
|
||||
aModes.Append (theMode);
|
||||
}
|
||||
aModes.Append( theMode );
|
||||
|
||||
if (theOwners.IsNull())
|
||||
{
|
||||
theOwners = new SelectMgr_IndexedMapOfOwner();
|
||||
}
|
||||
|
||||
for (TColStd_ListIteratorOfListOfInteger anItr (aModes); anItr.More(); anItr.Next())
|
||||
TColStd_ListIteratorOfListOfInteger anItr( aModes );
|
||||
for (; anItr.More(); anItr.Next() )
|
||||
{
|
||||
const int aMode = anItr.Value();
|
||||
const Handle(SelectMgr_Selection)& aSel = theIObj->Selection (aMode);
|
||||
if (aSel.IsNull())
|
||||
{
|
||||
int aMode = anItr.Value();
|
||||
if ( !theIObj->HasSelection( aMode ) )
|
||||
continue;
|
||||
}
|
||||
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
Handle(SelectMgr_Selection) aSel = theIObj->Selection(aMode);
|
||||
|
||||
for ( aSel->Init(); aSel->More(); aSel->Next() )
|
||||
{
|
||||
if (Handle(SelectBasics_SensitiveEntity) aEntity = aSelEntIter.Value()->BaseSensitive())
|
||||
{
|
||||
if (Handle(SelectMgr_EntityOwner) aOwner = Handle(SelectMgr_EntityOwner)::DownCast(aEntity->OwnerId()))
|
||||
{
|
||||
theOwners->Add (aOwner);
|
||||
}
|
||||
}
|
||||
Handle(SelectBasics_SensitiveEntity) aEntity = aSel->Sensitive()->BaseSensitive();
|
||||
if ( aEntity.IsNull() )
|
||||
continue;
|
||||
|
||||
Handle(SelectMgr_EntityOwner) aOwner =
|
||||
Handle(SelectMgr_EntityOwner)::DownCast(aEntity->OwnerId());
|
||||
if ( !aOwner.IsNull() )
|
||||
theOwners->Add( aOwner );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1438,11 +1431,13 @@ void AIS_InteractiveContext::EntityOwners(Handle(SelectMgr_IndexedMapOfOwner)& t
|
||||
//=======================================================================
|
||||
Standard_Integer AIS_InteractiveContext::NbSelected()
|
||||
{
|
||||
if (HasOpenedContext())
|
||||
Standard_Integer aNbSelected = 0;
|
||||
for (InitSelected(); MoreSelected(); NextSelected())
|
||||
{
|
||||
return myLocalContexts (myCurLocalIndex)->Selection()->Extent();
|
||||
aNbSelected++;
|
||||
}
|
||||
return mySelection->Extent();
|
||||
|
||||
return aNbSelected;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -202,8 +202,9 @@ Load(const Handle(AIS_InteractiveObject)& anInteractive,
|
||||
{
|
||||
if (myActiveObjects.IsBound (anInteractive))
|
||||
{
|
||||
if (const Handle(SelectMgr_Selection)& aSel = anInteractive->Selection (ActivationMode))
|
||||
if (anInteractive->HasSelection (ActivationMode))
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSel = anInteractive->Selection (ActivationMode);
|
||||
if (aSel->GetSelectionState() != SelectMgr_SOS_Activated)
|
||||
{
|
||||
if (!myMainVS->Contains (anInteractive))
|
||||
@@ -863,26 +864,24 @@ const Handle(AIS_LocalStatus)& AIS_LocalContext::Status(const Handle(AIS_Interac
|
||||
|
||||
void AIS_LocalContext::LoadContextObjects()
|
||||
{
|
||||
if (!myLoadDisplayed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AIS_ListOfInteractive LL;
|
||||
myCTX->DisplayedObjects(LL,Standard_True);
|
||||
for (AIS_ListIteratorOfListOfInteractive It (LL); It.More(); It.Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObj = It.Value();
|
||||
Handle(AIS_LocalStatus) Att = new AIS_LocalStatus();
|
||||
Att->SetDecomposition((anObj->AcceptShapeDecomposition() && myAcceptStdMode));
|
||||
Att->SetTemporary(Standard_False);
|
||||
Att->SetHilightMode(anObj->HasHilightMode()? anObj->HilightMode(): 0);
|
||||
for (SelectMgr_SequenceOfSelection::Iterator aSelIter (anObj->Selections()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSel = aSelIter.Value();
|
||||
aSel->SetSelectionState (SelectMgr_SOS_Deactivated);
|
||||
AIS_ListIteratorOfListOfInteractive It;
|
||||
if(myLoadDisplayed) {
|
||||
AIS_ListOfInteractive LL;
|
||||
myCTX->DisplayedObjects(LL,Standard_True);
|
||||
Handle(AIS_LocalStatus) Att;
|
||||
for (It.Initialize(LL);It.More();It.Next()){
|
||||
const Handle(AIS_InteractiveObject)& anObj = It.Value();
|
||||
Att= new AIS_LocalStatus();
|
||||
Att->SetDecomposition((anObj->AcceptShapeDecomposition() && myAcceptStdMode));
|
||||
Att->SetTemporary(Standard_False);
|
||||
Att->SetHilightMode(anObj->HasHilightMode()? anObj->HilightMode(): 0);
|
||||
for (anObj->Init(); anObj->More(); anObj->Next())
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSel = anObj->CurrentSelection();
|
||||
aSel->SetSelectionState (SelectMgr_SOS_Deactivated);
|
||||
}
|
||||
myActiveObjects.Bind(anObj,Att);
|
||||
}
|
||||
myActiveObjects.Bind(anObj,Att);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -91,8 +91,8 @@ public:
|
||||
Standard_Boolean AcceptErase() const;
|
||||
|
||||
Standard_EXPORT void SetContext (const Handle(AIS_InteractiveContext)& aCtx);
|
||||
|
||||
const Handle(AIS_Selection)& Selection() const { return mySelection; }
|
||||
|
||||
const Handle(AIS_Selection) Selection() const;
|
||||
|
||||
Standard_EXPORT void Terminate (const Standard_Boolean updateviewer = Standard_True);
|
||||
|
||||
|
@@ -18,6 +18,9 @@
|
||||
|
||||
#include <SelectMgr_OrFilter.hxx>
|
||||
|
||||
inline const Handle(AIS_Selection) AIS_LocalContext::Selection() const
|
||||
{return mySelection;}
|
||||
|
||||
inline void AIS_LocalContext::SetAutomaticHilight(const Standard_Boolean aStatus)
|
||||
{myAutoHilight = aStatus;}
|
||||
|
||||
|
@@ -804,10 +804,13 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
|
||||
{
|
||||
// 1. Collect selectable entities
|
||||
SelectMgr_IndexedMapOfOwner aValidOwners;
|
||||
|
||||
const TColStd_ListOfInteger& aModes = SelectionModes (theIO);
|
||||
for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
|
||||
|
||||
TColStd_ListIteratorOfListOfInteger aModeIter (aModes);
|
||||
for (; aModeIter.More(); aModeIter.Next())
|
||||
{
|
||||
const int aMode = aModeIter.Value();
|
||||
int aMode = aModeIter.Value();
|
||||
if (!theIO->HasSelection(aMode))
|
||||
{
|
||||
continue;
|
||||
@@ -818,16 +821,24 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(SelectMgr_Selection)& aSelection = theIO->Selection (aMode);
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (aSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
Handle(SelectMgr_Selection) aSelection = theIO->Selection(aMode);
|
||||
for (aSelection->Init(); aSelection->More(); aSelection->Next())
|
||||
{
|
||||
if (Handle(SelectBasics_SensitiveEntity) anEntity = aSelEntIter.Value()->BaseSensitive())
|
||||
Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive()->BaseSensitive();
|
||||
if (anEntity.IsNull())
|
||||
{
|
||||
if (Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId()))
|
||||
{
|
||||
aValidOwners.Add (anOwner);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(SelectMgr_EntityOwner) anOwner =
|
||||
Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
|
||||
|
||||
if (anOwner.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
aValidOwners.Add(anOwner);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,22 +43,6 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_Manipulator, AIS_InteractiveObject)
|
||||
|
||||
IMPLEMENT_HSEQUENCE(AIS_ManipulatorObjectSequence)
|
||||
|
||||
namespace
|
||||
{
|
||||
//! Return Ax1 for specified direction of Ax2.
|
||||
static gp_Ax1 getAx1FromAx2Dir (const gp_Ax2& theAx2,
|
||||
int theIndex)
|
||||
{
|
||||
switch (theIndex)
|
||||
{
|
||||
case 0: return gp_Ax1 (theAx2.Location(), theAx2.XDirection());
|
||||
case 1: return gp_Ax1 (theAx2.Location(), theAx2.YDirection());
|
||||
case 2: return theAx2.Axis();
|
||||
}
|
||||
throw Standard_ProgramError ("AIS_Manipulator - Invalid axis index");
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : init
|
||||
//purpose :
|
||||
@@ -400,19 +384,22 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
// Initialize start reference data
|
||||
if (!myHasStartedTransformation)
|
||||
{
|
||||
myStartTrsfs.Clear();
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
for (AIS_ManipulatorObjectSequence::Iterator anObjIter (*anObjects); anObjIter.More(); anObjIter.Next())
|
||||
myStartTrsfs.Clear();
|
||||
for (Standard_Integer anIt = anObjects->Lower(); anIt <= anObjects->Upper(); ++anIt)
|
||||
{
|
||||
myStartTrsfs.Append (anObjIter.Value()->LocalTransformation());
|
||||
myStartTrsfs.Append (anObjects->Value (anIt)->LocalTransformation());
|
||||
}
|
||||
myStartPosition = myPosition;
|
||||
}
|
||||
|
||||
// Get 3d point with projection vector
|
||||
Graphic3d_Vec3d anInputPoint, aProj;
|
||||
Graphic3d_Vec3d anInputPoint;
|
||||
Graphic3d_Vec3d aProj;
|
||||
theView->ConvertWithProj (theMaxX, theMaxY, anInputPoint.x(), anInputPoint.y(), anInputPoint.z(), aProj.x(), aProj.y(), aProj.z());
|
||||
const gp_Lin anInputLine (gp_Pnt (anInputPoint.x(), anInputPoint.y(), anInputPoint.z()), gp_Dir (aProj.x(), aProj.y(), aProj.z()));
|
||||
gp_Lin anInputLine (gp_Pnt (anInputPoint.x(), anInputPoint.y(), anInputPoint.z()), gp_Dir (aProj.x(), aProj.y(), aProj.z()));
|
||||
gp_Pnt aNewPosition = gp::Origin();
|
||||
|
||||
switch (myCurrentMode)
|
||||
{
|
||||
case AIS_MM_Translation:
|
||||
@@ -423,7 +410,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
GeomAPI_ExtremaCurveCurve anExtrema (anInputCurve, aCurve);
|
||||
gp_Pnt aP1, aP2;
|
||||
anExtrema.NearestPoints (aP1, aP2);
|
||||
const gp_Pnt aNewPosition = aP2;
|
||||
aNewPosition = aP2;
|
||||
|
||||
if (!myHasStartedTransformation)
|
||||
{
|
||||
@@ -440,28 +427,26 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
gp_Trsf aNewTrsf;
|
||||
aNewTrsf.SetTranslation (gp_Vec(myStartPick, aNewPosition));
|
||||
theTrsf *= aNewTrsf;
|
||||
return Standard_True;
|
||||
break;
|
||||
}
|
||||
case AIS_MM_Rotation:
|
||||
{
|
||||
const gp_Pnt aPosLoc = myStartPosition.Location();
|
||||
const gp_Ax1 aCurrAxis = getAx1FromAx2Dir (myStartPosition, myCurrentIndex);
|
||||
|
||||
Handle(Geom_Curve) anInputCurve = new Geom_Line (anInputLine);
|
||||
Handle(Geom_Surface) aSurface = new Geom_Plane (aPosLoc, aCurrAxis.Direction());
|
||||
Handle(Geom_Surface) aSurface = new Geom_Plane (myPosition.Location(), myAxes[myCurrentIndex].Position().Direction());
|
||||
GeomAPI_IntCS aIntersector (anInputCurve, aSurface);
|
||||
if (!aIntersector.IsDone() || aIntersector.NbPoints() < 1)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
const gp_Pnt aNewPosition = aIntersector.Point (1);
|
||||
aNewPosition = aIntersector.Point (1);
|
||||
|
||||
if (!myHasStartedTransformation)
|
||||
{
|
||||
myStartPick = aNewPosition;
|
||||
myHasStartedTransformation = Standard_True;
|
||||
gp_Dir aStartAxis = gce_MakeDir (aPosLoc, myStartPick);
|
||||
myPrevState = aStartAxis.AngleWithRef (gce_MakeDir(aPosLoc, aNewPosition), aCurrAxis.Direction());
|
||||
gp_Dir aStartAxis = gce_MakeDir (myPosition.Location(), myStartPick);
|
||||
myPrevState = aStartAxis.AngleWithRef (gce_MakeDir(myPosition.Location(), aNewPosition), myAxes[myCurrentIndex].Position().Direction());
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -470,17 +455,17 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
gp_Dir aStartAxis = aPosLoc.IsEqual (myStartPick, Precision::Confusion())
|
||||
? getAx1FromAx2Dir (myStartPosition, (myCurrentIndex + 1) % 3).Direction()
|
||||
: gce_MakeDir (aPosLoc, myStartPick);
|
||||
gp_Dir aStartAxis = myPosition.Location().IsEqual (myStartPick, Precision::Confusion())
|
||||
? myAxes[(myCurrentIndex + 1) % 3].Position().Direction()
|
||||
: gce_MakeDir (myPosition.Location(), myStartPick);
|
||||
|
||||
gp_Dir aCurrentAxis = gce_MakeDir (aPosLoc, aNewPosition);
|
||||
Standard_Real anAngle = aStartAxis.AngleWithRef (aCurrentAxis, aCurrAxis.Direction());
|
||||
gp_Dir aCurrentAxis = gce_MakeDir (myPosition.Location(), aNewPosition);
|
||||
Standard_Real anAngle = aStartAxis.AngleWithRef (aCurrentAxis, myAxes[myCurrentIndex].Position().Direction());
|
||||
|
||||
// Change value of an angle if it should have different sign.
|
||||
if (anAngle * myPrevState < 0 && Abs (anAngle) < M_PI_2)
|
||||
{
|
||||
Standard_Real aSign = myPrevState > 0 ? -1.0 : 1.0;
|
||||
Standard_ShortReal aSign = myPrevState > 0 ? -1.0f : 1.0f;
|
||||
anAngle = aSign * (M_PI * 2 - anAngle);
|
||||
}
|
||||
|
||||
@@ -490,10 +475,10 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
}
|
||||
|
||||
gp_Trsf aNewTrsf;
|
||||
aNewTrsf.SetRotation (aCurrAxis, anAngle);
|
||||
aNewTrsf.SetRotation (myAxes[myCurrentIndex].Position(), anAngle);
|
||||
theTrsf *= aNewTrsf;
|
||||
myPrevState = anAngle;
|
||||
return Standard_True;
|
||||
break;
|
||||
}
|
||||
case AIS_MM_Scaling:
|
||||
{
|
||||
@@ -501,7 +486,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
Handle(Geom_Curve) anInputCurve = new Geom_Line (anInputLine);
|
||||
Handle(Geom_Curve) aCurve = new Geom_Line (aLine);
|
||||
GeomAPI_ExtremaCurveCurve anExtrema (anInputCurve, aCurve);
|
||||
gp_Pnt aNewPosition, aTmp;
|
||||
gp_Pnt aTmp;
|
||||
anExtrema.NearestPoints (aTmp, aNewPosition);
|
||||
|
||||
if (!myHasStartedTransformation)
|
||||
@@ -523,14 +508,13 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
aNewTrsf.SetScale (myPosition.Location(), aCoeff);
|
||||
|
||||
theTrsf = aNewTrsf;
|
||||
return Standard_True;
|
||||
break;
|
||||
}
|
||||
case AIS_MM_None:
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -560,19 +544,18 @@ void AIS_Manipulator::StopTransform (const Standard_Boolean theToApply)
|
||||
}
|
||||
|
||||
myHasStartedTransformation = Standard_False;
|
||||
if (theToApply)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
AIS_ManipulatorObjectSequence::Iterator anObjIter (*anObjects);
|
||||
NCollection_Sequence<gp_Trsf>::Iterator aTrsfIter (myStartTrsfs);
|
||||
for (; anObjIter.More(); anObjIter.Next(), aTrsfIter.Next())
|
||||
if (!theToApply)
|
||||
{
|
||||
anObjIter.ChangeValue()->SetLocalTransformation (aTrsfIter.Value());
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
|
||||
for (Standard_Integer anIt = anObjects->Lower(); anIt <= anObjects->Upper(); ++anIt)
|
||||
{
|
||||
anObjects->Value (anIt)->SetLocalTransformation (myStartTrsfs(anIt));
|
||||
}
|
||||
|
||||
SetPosition (myStartPosition);
|
||||
}
|
||||
SetPosition (myStartPosition);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -586,14 +569,11 @@ void AIS_Manipulator::Transform (const gp_Trsf& theTrsf)
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
|
||||
for (Standard_Integer anIt = anObjects->Lower(); anIt <= anObjects->Upper(); ++anIt)
|
||||
{
|
||||
Handle(AIS_ManipulatorObjectSequence) anObjects = Objects();
|
||||
AIS_ManipulatorObjectSequence::Iterator anObjIter (*anObjects);
|
||||
NCollection_Sequence<gp_Trsf>::Iterator aTrsfIter (myStartTrsfs);
|
||||
for (; anObjIter.More(); anObjIter.Next(), aTrsfIter.Next())
|
||||
{
|
||||
anObjIter.ChangeValue()->SetLocalTransformation (theTrsf * aTrsfIter.Value());
|
||||
}
|
||||
anObjects->Value (anIt)->SetLocalTransformation (theTrsf * myStartTrsfs(anIt));
|
||||
}
|
||||
|
||||
if ((myCurrentMode == AIS_MM_Translation && myBehaviorOnTransform.FollowTranslation)
|
||||
@@ -633,9 +613,10 @@ void AIS_Manipulator::SetPosition (const gp_Ax2& thePosition)
|
||||
|| !myPosition.XDirection().IsEqual (thePosition.XDirection(), Precision::Angular()))
|
||||
{
|
||||
myPosition = thePosition;
|
||||
myAxes[0].SetPosition (getAx1FromAx2Dir (thePosition, 0));
|
||||
myAxes[1].SetPosition (getAx1FromAx2Dir (thePosition, 1));
|
||||
myAxes[2].SetPosition (getAx1FromAx2Dir (thePosition, 2));
|
||||
myAxes[0].SetPosition (gp_Ax1 (myPosition.Location(), myPosition.XDirection()));
|
||||
myAxes[1].SetPosition (gp_Ax1 (myPosition.Location(), myPosition.YDirection()));
|
||||
myAxes[2].SetPosition (gp_Ax1 (myPosition.Location(), myPosition.Direction()));
|
||||
|
||||
updateTransformation();
|
||||
}
|
||||
}
|
||||
|
@@ -215,18 +215,18 @@ public:
|
||||
//! @return true if manipulator is attached to some interactive object (has owning object).
|
||||
Standard_Boolean IsAttached() const { return HasOwner(); }
|
||||
|
||||
//! @return true if some part of manipulator is selected (transformation mode is active, and owning object can be transformed).
|
||||
//! @return true if some part of manipulator is selected (tranformation mode is active, and owning object can be rtansformated).
|
||||
Standard_Boolean HasActiveMode() const { return IsAttached() && myCurrentMode != AIS_MM_None; }
|
||||
|
||||
Standard_Boolean HasActiveTransformation() { return myHasStartedTransformation; }
|
||||
|
||||
gp_Trsf StartTransformation() const { return !myStartTrsfs.IsEmpty() ? myStartTrsfs.First() : gp_Trsf(); }
|
||||
gp_Trsf StartTransformation() const { return myStartTrsfs.Size() < 1 ? gp_Trsf() : myStartTrsfs(1); }
|
||||
|
||||
gp_Trsf StartTransformation (Standard_Integer theIndex) const
|
||||
gp_Trsf StartTransformation (const Standard_Integer theIndex) const
|
||||
{
|
||||
Standard_ProgramError_Raise_if (theIndex < 1 || theIndex > Objects()->Upper(),
|
||||
"AIS_Manipulator::StartTransformation(): theIndex is out of bounds");
|
||||
return !myStartTrsfs.IsEmpty() ? myStartTrsfs (theIndex) : gp_Trsf();
|
||||
return myStartTrsfs.Size() < 1 ? gp_Trsf() : myStartTrsfs (theIndex);
|
||||
}
|
||||
|
||||
public: //! @name Configuration of graphical transformations
|
||||
@@ -245,7 +245,7 @@ public: //! @name Configuration of graphical transformations
|
||||
//! Redefines transform persistence management to setup transformation for sub-presentation of axes.
|
||||
//! @warning this interactive object does not support custom transformation persistence when
|
||||
//! using \sa ZoomPersistence mode. In this mode the transformation persistence flags for
|
||||
//! presentations are overridden by this class.
|
||||
//! presentations are overriden by this class.
|
||||
//! @warning Invokes debug assertion to catch incompatible usage of the method with \sa ZoomPersistence mode,
|
||||
//! silently does nothing in release mode.
|
||||
//! @warning revise use of AdjustSize argument of of \sa AttachToObjects method
|
||||
@@ -298,17 +298,17 @@ public:
|
||||
public: //! @name Presentation computation
|
||||
|
||||
//! Fills presentation.
|
||||
//! @note Manipulator presentation does not use display mode and for all modes has the same presentation.
|
||||
//! @note Manipulator presentation does not use display mode and for all modes has the same presenatation.
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode = 0) Standard_OVERRIDE;
|
||||
|
||||
//! Computes selection sensitive zones (triangulation) for manipulator.
|
||||
//! @param theNode [in] Selection mode that is treated as transformation mode.
|
||||
//! @param theNode [in] Seldction mode that is treated as transformation mode.
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
|
||||
//! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overridden methods.
|
||||
//! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overriden methods.
|
||||
Standard_EXPORT virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE
|
||||
{
|
||||
return Standard_False;
|
||||
@@ -352,7 +352,7 @@ protected:
|
||||
Standard_EXPORT virtual void setLocalTransformation (const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
|
||||
using AIS_InteractiveObject::SetLocalTransformation; // hide visibility
|
||||
|
||||
protected: //! @name Auxiliary classes to fill presentation with proper primitives
|
||||
protected: //! @name Auxilliary classes to fill presentation with proper primitives
|
||||
|
||||
class Quadric
|
||||
{
|
||||
@@ -616,16 +616,16 @@ protected:
|
||||
|
||||
Axis myAxes[3]; //!< Tree axes of the manipulator.
|
||||
Sphere myCenter; //!< Visual part displaying the center sphere of the manipulator.
|
||||
gp_Ax2 myPosition; //!< Position of the manipulator object. it displays its location and position of its axes.
|
||||
gp_Ax2 myPosition; //!< Position of the manipualtor object. it displayes its location and position of its axes.
|
||||
|
||||
Standard_Integer myCurrentIndex; //!< Index of active axis.
|
||||
AIS_ManipulatorMode myCurrentMode; //!< Name of active manipulation mode.
|
||||
AIS_ManipulatorMode myCurrentMode; //!< Name of active manipualtion mode.
|
||||
|
||||
Standard_Boolean myIsActivationOnDetection; //!< Manual activation of modes (not on parts selection).
|
||||
Standard_Boolean myIsZoomPersistentMode; //!< Zoom persistence mode activation.
|
||||
BehaviorOnTransform myBehaviorOnTransform; //!< Behavior settings applied on manipulator when transforming an object.
|
||||
|
||||
protected: //! @name Fields for interactive transformation. Fields only for internal needs. They do not have public interface.
|
||||
protected: //! @name Fields for interactive trnasformation. Fields only for internal needs. They do not have public interface.
|
||||
|
||||
NCollection_Sequence<gp_Trsf> myStartTrsfs; //!< Owning object transformation for start. It is used internally.
|
||||
Standard_Boolean myHasStartedTransformation; //!< Shows if transformation is processed (sequential calls of Transform()).
|
||||
@@ -633,7 +633,7 @@ protected: //! @name Fields for interactive transformation. Fields only for inte
|
||||
gp_Pnt myStartPick; //! 3d point corresponding to start mouse pick.
|
||||
Standard_Real myPrevState; //! Previous value of angle during rotation.
|
||||
|
||||
//! Aspect used to color current detected part and current selected part.
|
||||
//! Aspect used to colour current detected part and current selected part.
|
||||
Handle(Prs3d_ShadingAspect) myHighlightAspect;
|
||||
public:
|
||||
|
||||
|
@@ -30,13 +30,14 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_MultipleConnectedInteractive,AIS_InteractiveObjec
|
||||
|
||||
//=======================================================================
|
||||
//function : AIS_MultipleConnectedInteractive
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
AIS_MultipleConnectedInteractive::AIS_MultipleConnectedInteractive()
|
||||
: AIS_InteractiveObject (PrsMgr_TOP_AllView)
|
||||
: AIS_InteractiveObject (PrsMgr_TOP_AllView)
|
||||
{
|
||||
myHasOwnPresentations = Standard_False;
|
||||
myAssemblyOwner = NULL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -212,27 +213,53 @@ Standard_Boolean AIS_MultipleConnectedInteractive::AcceptShapeDecomposition() co
|
||||
void AIS_MultipleConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selection)& /*theSelection*/,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (theMode == 0)
|
||||
if (theMode != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anIter (Children()); anIter.More(); anIter.Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aChild = Handle(AIS_InteractiveObject)::DownCast (anIter.Value());
|
||||
if (aChild.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!aChild->HasSelection (theMode))
|
||||
{
|
||||
aChild->RecomputePrimitives (theMode);
|
||||
}
|
||||
|
||||
Handle(SelectMgr_Selection) aSelection = new SelectMgr_Selection (theMode);
|
||||
aChild->ComputeSelection (aSelection, theMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GlobalSelOwner
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(SelectMgr_EntityOwner) AIS_MultipleConnectedInteractive::GlobalSelOwner() const
|
||||
{
|
||||
return myAssemblyOwner;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasSelection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_MultipleConnectedInteractive::HasSelection (const Standard_Integer theMode) const
|
||||
{
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anIter (Children()); anIter.More(); anIter.Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aChild = Handle(AIS_InteractiveObject)::DownCast (anIter.Value());
|
||||
if (aChild.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!aChild->HasSelection (theMode))
|
||||
{
|
||||
aChild->RecomputePrimitives (theMode);
|
||||
}
|
||||
|
||||
Handle(SelectMgr_Selection) aSelection = new SelectMgr_Selection (theMode);
|
||||
aChild->ComputeSelection (aSelection, theMode);
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -72,11 +72,12 @@ public:
|
||||
//! may be decomposed into sub-shapes for dynamic selection.
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns common entity owner if the object is an assembly
|
||||
virtual const Handle(SelectMgr_EntityOwner)& GetAssemblyOwner() const Standard_OVERRIDE { return myAssemblyOwner; }
|
||||
|
||||
//! Returns the owner of mode for selection of object as a whole
|
||||
virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const Standard_OVERRIDE { return myAssemblyOwner; }
|
||||
Standard_EXPORT virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if a selection corresponding to the selection mode theMode was computed for all
|
||||
//! children of multiple connected interactive object.
|
||||
Standard_EXPORT virtual Standard_Boolean HasSelection (const Standard_Integer theMode) const Standard_OVERRIDE;
|
||||
|
||||
//! Assigns interactive context.
|
||||
Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& theCtx) Standard_OVERRIDE;
|
||||
@@ -141,10 +142,6 @@ private:
|
||||
//! Computes the selection for whole subtree in scene hierarchy.
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
|
||||
Handle(SelectMgr_EntityOwner) myAssemblyOwner;
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_MultipleConnectedInteractive, AIS_InteractiveObject)
|
||||
|
@@ -41,7 +41,6 @@ void AIS_Selection::Clear()
|
||||
{
|
||||
myresult.Clear();
|
||||
myResultMap.Clear();
|
||||
myIterator = AIS_NListOfEntityOwner::Iterator();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -35,8 +35,6 @@
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_SequenceOfGroup.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <HLRBRep.hxx>
|
||||
#include <OSD_Timer.hxx>
|
||||
#include <Precision.hxx>
|
||||
@@ -159,11 +157,14 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
OCC_CATCH_SIGNALS
|
||||
StdPrs_WFShape::Add (aPrs, myshape, myDrawer);
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString()
|
||||
+ "Error: AIS_Shape::Compute() wireframe presentation builder has failed ("
|
||||
+ anException.GetMessageString() + ")", Message_Fail);
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "AIS_Shape::Compute() failed" << endl;
|
||||
cout << "a Shape should be incorrect : No Compute can be maked on it " << endl;
|
||||
#endif
|
||||
// presentation of the bounding box is calculated
|
||||
// Compute(aPresentationManager,aPrs,2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -190,11 +191,11 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
|
||||
myUVOrigin, myUVRepeat, myUVScale);
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString()
|
||||
+ "Error: AIS_Shape::Compute() shaded presentation builder has failed ("
|
||||
+ anException.GetMessageString() + ")", Message_Fail);
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "AIS_Shape::Compute() in ShadingMode failed" << endl;
|
||||
#endif
|
||||
StdPrs_WFShape::Add (aPrs, myshape, myDrawer);
|
||||
}
|
||||
}
|
||||
@@ -226,88 +227,150 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : computeHlrPresentation
|
||||
//purpose :
|
||||
//function : Compute
|
||||
//purpose : Hidden Line Removal
|
||||
//=======================================================================
|
||||
void AIS_Shape::computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(Prs3d_Drawer)& theDrawer)
|
||||
void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
const Handle(Prs3d_Presentation)& aPresentation)
|
||||
{
|
||||
if (theShape.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
Compute(aProjector,aPresentation,myshape);
|
||||
}
|
||||
|
||||
switch (theShape.ShapeType())
|
||||
{
|
||||
case TopAbs_VERTEX:
|
||||
case TopAbs_EDGE:
|
||||
case TopAbs_WIRE:
|
||||
{
|
||||
thePrs->SetDisplayPriority (4);
|
||||
StdPrs_WFShape::Add (thePrs, theShape, theDrawer);
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
const Handle(Geom_Transformation)& TheTrsf,
|
||||
const Handle(Prs3d_Presentation)& aPresentation)
|
||||
{
|
||||
const TopLoc_Location& loc = myshape.Location();
|
||||
TopoDS_Shape shbis = myshape.Located(TopLoc_Location(TheTrsf->Trsf())*loc);
|
||||
Compute(aProjector,aPresentation,shbis);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const TopoDS_Shape& SH)
|
||||
{
|
||||
if (SH.ShapeType() == TopAbs_COMPOUND) {
|
||||
TopoDS_Iterator anExplor (SH);
|
||||
|
||||
if (!anExplor.More()) // Shape vide -> Assemblage vide.
|
||||
return;
|
||||
}
|
||||
case TopAbs_COMPOUND:
|
||||
{
|
||||
TopoDS_Iterator anExplor (theShape);
|
||||
if (!anExplor.More())
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Drawer)& aDefDrawer = theDrawer->Link();
|
||||
if (aDefDrawer->DrawHiddenLine())
|
||||
{
|
||||
theDrawer->EnableDrawHiddenLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
theDrawer->DisableDrawHiddenLine();
|
||||
}
|
||||
Handle (Prs3d_Drawer) defdrawer = GetContext()->DefaultDrawer();
|
||||
if (defdrawer->DrawHiddenLine())
|
||||
{myDrawer->EnableDrawHiddenLine();}
|
||||
else {myDrawer->DisableDrawHiddenLine();}
|
||||
|
||||
const Aspect_TypeOfDeflection aPrevDef = aDefDrawer->TypeOfDeflection();
|
||||
aDefDrawer->SetTypeOfDeflection (Aspect_TOD_RELATIVE);
|
||||
if (theDrawer->IsAutoTriangulation())
|
||||
{
|
||||
StdPrs_ToolTriangulatedShape::ClearOnOwnDeflectionChange (theShape, theDrawer, Standard_True);
|
||||
}
|
||||
Aspect_TypeOfDeflection prevdef = defdrawer->TypeOfDeflection();
|
||||
defdrawer->SetTypeOfDeflection(Aspect_TOD_RELATIVE);
|
||||
|
||||
if (myDrawer->IsAutoTriangulation())
|
||||
{
|
||||
try
|
||||
// coefficients for calculation
|
||||
Standard_Real aPrevAngle, aNewAngle, aPrevCoeff, aNewCoeff;
|
||||
Standard_Boolean isOwnHLRDeviationAngle = OwnHLRDeviationAngle (aNewAngle, aPrevAngle);
|
||||
Standard_Boolean isOwnHLRDeviationCoefficient = OwnHLRDeviationCoefficient (aNewCoeff, aPrevCoeff);
|
||||
if (((Abs (aNewAngle - aPrevAngle) > Precision::Angular()) && isOwnHLRDeviationAngle) ||
|
||||
((Abs (aNewCoeff - aPrevCoeff) > Precision::Confusion()) && isOwnHLRDeviationCoefficient))
|
||||
{
|
||||
BRepTools::Clean(SH);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
switch (theDrawer->TypeOfHLR())
|
||||
{
|
||||
switch (TypeOfHLR()) {
|
||||
case Prs3d_TOH_Algo:
|
||||
StdPrs_HLRShape::Add (thePrs, theShape, theDrawer, theProjector);
|
||||
StdPrs_HLRShape::Add (aPresentation, SH, myDrawer, aProjector);
|
||||
break;
|
||||
case Prs3d_TOH_PolyAlgo:
|
||||
default:
|
||||
StdPrs_HLRPolyShape::Add (thePrs, theShape, theDrawer, theProjector);
|
||||
StdPrs_HLRPolyShape::Add (aPresentation, SH, myDrawer, aProjector);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString()
|
||||
+ "Error: AIS_Shape::Compute() HLR Algorithm has failed ("
|
||||
+ anException.GetMessageString() + ")", Message_Fail);
|
||||
StdPrs_WFShape::Add (thePrs, theShape, theDrawer);
|
||||
catch (Standard_Failure) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout <<"AIS_Shape::Compute(Proj) HLR Algorithm failed" << endl;
|
||||
#endif
|
||||
StdPrs_WFShape::Add(aPresentation,SH,myDrawer);
|
||||
}
|
||||
}
|
||||
|
||||
aDefDrawer->SetTypeOfDeflection (aPrevDef);
|
||||
defdrawer->SetTypeOfDeflection (prevdef);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SelectionType
|
||||
//purpose : gives the type according to the Index of Selection Mode
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_ShapeEnum AIS_Shape::SelectionType(const Standard_Integer aMode)
|
||||
{
|
||||
switch(aMode){
|
||||
case 1:
|
||||
return TopAbs_VERTEX;
|
||||
case 2:
|
||||
return TopAbs_EDGE;
|
||||
case 3:
|
||||
return TopAbs_WIRE;
|
||||
case 4:
|
||||
return TopAbs_FACE;
|
||||
case 5:
|
||||
return TopAbs_SHELL;
|
||||
case 6:
|
||||
return TopAbs_SOLID;
|
||||
case 7:
|
||||
return TopAbs_COMPSOLID;
|
||||
case 8:
|
||||
return TopAbs_COMPOUND;
|
||||
case 0:
|
||||
default:
|
||||
return TopAbs_SHAPE;
|
||||
}
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SelectionType
|
||||
//purpose : gives the SelectionMode according to the Type od Decomposition...
|
||||
//=======================================================================
|
||||
Standard_Integer AIS_Shape::SelectionMode(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
switch(aType){
|
||||
case TopAbs_VERTEX:
|
||||
return 1;
|
||||
case TopAbs_EDGE:
|
||||
return 2;
|
||||
case TopAbs_WIRE:
|
||||
return 3;
|
||||
case TopAbs_FACE:
|
||||
return 4;
|
||||
case TopAbs_SHELL:
|
||||
return 5;
|
||||
case TopAbs_SOLID:
|
||||
return 6;
|
||||
case TopAbs_COMPSOLID:
|
||||
return 7;
|
||||
case TopAbs_COMPOUND:
|
||||
return 8;
|
||||
case TopAbs_SHAPE:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeSelection
|
||||
//purpose :
|
||||
@@ -330,8 +393,7 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
// POP protection against crash in low layers
|
||||
|
||||
Standard_Real aDeflection = Prs3d::GetDeflection(shape, myDrawer);
|
||||
try
|
||||
{
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
StdSelect_BRepSelectionTool::Load(aSelection,
|
||||
this,
|
||||
@@ -340,14 +402,9 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
aDeflection,
|
||||
myDrawer->HLRAngle(),
|
||||
myDrawer->IsAutoTriangulation());
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString()
|
||||
+ "Error: AIS_Shape::ComputeSelection(" + aMode + ") has failed ("
|
||||
+ anException.GetMessageString() + ")", Message_Fail);
|
||||
if (aMode == 0)
|
||||
{
|
||||
} catch ( Standard_Failure ) {
|
||||
// cout << "a Shape should be incorrect : A Selection on the Bnd is activated "<<endl;
|
||||
if ( aMode == 0 ) {
|
||||
aSelection->Clear();
|
||||
Bnd_Box B = BoundingBox();
|
||||
Handle(StdSelect_BRepOwner) aOwner = new StdSelect_BRepOwner(shape,this);
|
||||
|
@@ -211,42 +211,23 @@ public:
|
||||
//! Returns the transparency attributes of the shape accordingly to
|
||||
//! the current facing model;
|
||||
Standard_EXPORT virtual Standard_Real Transparency() const Standard_OVERRIDE;
|
||||
|
||||
//! Return shape type for specified selection mode.
|
||||
static TopAbs_ShapeEnum SelectionType (const Standard_Integer theSelMode)
|
||||
{
|
||||
switch (theSelMode)
|
||||
{
|
||||
case 1: return TopAbs_VERTEX;
|
||||
case 2: return TopAbs_EDGE;
|
||||
case 3: return TopAbs_WIRE;
|
||||
case 4: return TopAbs_FACE;
|
||||
case 5: return TopAbs_SHELL;
|
||||
case 6: return TopAbs_SOLID;
|
||||
case 7: return TopAbs_COMPSOLID;
|
||||
case 8: return TopAbs_COMPOUND;
|
||||
case 0: return TopAbs_SHAPE;
|
||||
}
|
||||
return TopAbs_SHAPE;
|
||||
}
|
||||
|
||||
//! Return selection mode for specified shape type.
|
||||
static Standard_Integer SelectionMode (const TopAbs_ShapeEnum theShapeType)
|
||||
{
|
||||
switch (theShapeType)
|
||||
{
|
||||
case TopAbs_VERTEX: return 1;
|
||||
case TopAbs_EDGE: return 2;
|
||||
case TopAbs_WIRE: return 3;
|
||||
case TopAbs_FACE: return 4;
|
||||
case TopAbs_SHELL: return 5;
|
||||
case TopAbs_SOLID: return 6;
|
||||
case TopAbs_COMPSOLID: return 7;
|
||||
case TopAbs_COMPOUND: return 8;
|
||||
case TopAbs_SHAPE: return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! Activates the same TopAbs shape enumerations as
|
||||
//! those used by SelectionMode assigning a type to the mode aDecompositionMode.
|
||||
Standard_EXPORT static TopAbs_ShapeEnum SelectionType (const Standard_Integer aDecompositionMode);
|
||||
|
||||
//! Establishes an equivalence between a mode and the
|
||||
//! type, aShapeType, of selection. The correspondences are as follows:
|
||||
//! - mode 0 - Shape
|
||||
//! - mode 1 - Vertex
|
||||
//! - mode 2 - Edge
|
||||
//! - mode 3 - Wire
|
||||
//! - mode 4 - Face
|
||||
//! - mode 5 - Shell
|
||||
//! - mode 6 - Solid
|
||||
//! - mode 7 - Compsolid
|
||||
//! - mode 8 - Compound
|
||||
Standard_EXPORT static Standard_Integer SelectionMode (const TopAbs_ShapeEnum aShapeType);
|
||||
|
||||
public: //! @name methods to alter texture mapping properties
|
||||
|
||||
@@ -275,31 +256,13 @@ public: //! @name methods to alter texture mapping properties
|
||||
|
||||
protected:
|
||||
|
||||
//! Compute normal presentation.
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
|
||||
//! Compute projected presentation.
|
||||
virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE
|
||||
{
|
||||
computeHlrPresentation (theProjector, thePrs, myshape, myDrawer);
|
||||
}
|
||||
|
||||
//! Compute projected presentation with transformation.
|
||||
virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Geom_Transformation)& theTrsf,
|
||||
const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE
|
||||
{
|
||||
const TopLoc_Location& aLoc = myshape.Location();
|
||||
const TopoDS_Shape aShape = myshape.Located (TopLoc_Location (theTrsf->Trsf()) * aLoc);
|
||||
computeHlrPresentation (theProjector, thePrs, aShape, myDrawer);
|
||||
}
|
||||
|
||||
//! Compute selection.
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void LoadRecomputable (const Standard_Integer TheMode);
|
||||
|
||||
@@ -311,13 +274,9 @@ protected:
|
||||
|
||||
Standard_EXPORT void setMaterial (const Handle(Prs3d_Drawer)& theDrawer, const Graphic3d_MaterialAspect& theMaterial, const Standard_Boolean theToKeepColor, const Standard_Boolean theToKeepTransp) const;
|
||||
|
||||
public:
|
||||
private:
|
||||
|
||||
//! Compute HLR presentation for specified shape.
|
||||
Standard_EXPORT static void computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(Prs3d_Drawer)& theDrawer);
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& ashape);
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -103,8 +103,6 @@ void AIS_Trihedron::setOwnDatumAspect()
|
||||
if (myDrawer->Link().IsNull())
|
||||
return;
|
||||
|
||||
myDrawer->DatumAspect()->SetDrawArrows (myDrawer->Link()->DatumAspect()->ToDrawArrows());
|
||||
myDrawer->DatumAspect()->SetDrawLabels (myDrawer->Link()->DatumAspect()->ToDrawLabels());
|
||||
*myDrawer->DatumAspect()->TextAspect()->Aspect() =
|
||||
*myDrawer->Link()->DatumAspect()->TextAspect()->Aspect();
|
||||
*myDrawer->DatumAspect()->PointAspect()->Aspect() =
|
||||
@@ -495,14 +493,14 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
||||
anAxisGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
|
||||
|
||||
// draw arrow
|
||||
Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
anArrowGroup->SetPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
|
||||
|
||||
Prs3d_DatumParts anArrowPart = anAspect->ArrowPartForAxis (aPart);
|
||||
if (!anAspect->DrawDatumPart (anArrowPart))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
anArrowGroup->SetGroupPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
|
||||
anArrowGroup->AddPrimitiveArray (arrayOfPrimitives (anArrowPart));
|
||||
}
|
||||
}
|
||||
@@ -716,25 +714,6 @@ void AIS_Trihedron::UnsetColor()
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ToDrawArrows
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_Trihedron::ToDrawArrows() const
|
||||
{
|
||||
return myDrawer->DatumAspect()->ToDrawArrows();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDrawArrows
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Trihedron::SetDrawArrows (const Standard_Boolean theToDraw)
|
||||
{
|
||||
setOwnDatumAspect();
|
||||
myDrawer->DatumAspect()->SetDrawArrows (theToDraw);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : createSensitiveEntity
|
||||
//purpose :
|
||||
|
@@ -152,12 +152,6 @@ public:
|
||||
//! Standard_DEPRECATED("This method is deprecated - SetColor() should be called instead")
|
||||
Standard_EXPORT void SetAxisColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Returns true if arrows are to be drawn
|
||||
Standard_EXPORT Standard_Boolean ToDrawArrows() const;
|
||||
|
||||
//! Sets whether to draw the arrows in visualization
|
||||
Standard_EXPORT void SetDrawArrows (const Standard_Boolean theToDraw);
|
||||
|
||||
//! Sets priority of selection for owner of the given type
|
||||
void SetSelectionPriority (Prs3d_DatumParts thePart,
|
||||
Standard_Integer thePriority)
|
||||
|
@@ -45,34 +45,29 @@ static Standard_Boolean IsTimeStamp
|
||||
case 4 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
break;
|
||||
case 5 : if (uncar != '-') return Standard_False;
|
||||
Standard_FALLTHROUGH
|
||||
case 6 : if (uncar != '0' && uncar != '1') return Standard_False;
|
||||
break;
|
||||
case 7 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False;
|
||||
break;
|
||||
case 8 : if (uncar != '-') return Standard_False;
|
||||
Standard_FALLTHROUGH
|
||||
case 9 : if (uncar < '0' || uncar > '3') return Standard_False;
|
||||
break;
|
||||
case 10 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False;
|
||||
break;
|
||||
case 11 : if (uncar != 'T') return Standard_False;
|
||||
Standard_FALLTHROUGH
|
||||
case 12 : if (uncar < '0' || uncar > '2') return Standard_False;
|
||||
break;
|
||||
case 13 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False;
|
||||
break;
|
||||
case 14 : if (uncar != ':') return Standard_False;
|
||||
Standard_FALLTHROUGH
|
||||
case 15 : if (uncar < '0' || uncar > '5') return Standard_False;
|
||||
break;
|
||||
case 16 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
break;
|
||||
case 17 : if (uncar != ':') return Standard_False;
|
||||
Standard_FALLTHROUGH
|
||||
case 18 : if (uncar < '0' || uncar > '5') return Standard_False;
|
||||
break;
|
||||
case 19 : if (uncar < '0' || uncar > '9') return Standard_False;
|
||||
|
@@ -138,12 +138,12 @@ Standard_Boolean AppDef_MyLineTool::Tangency(const AppDef_MultiLine& ML,
|
||||
}
|
||||
|
||||
|
||||
AppDef_MultiLine AppDef_MyLineTool::MakeMLBetween(const AppDef_MultiLine& theML,
|
||||
AppDef_MultiLine& AppDef_MyLineTool::MakeMLBetween(const AppDef_MultiLine&,
|
||||
const Standard_Integer ,
|
||||
const Standard_Integer ,
|
||||
const Standard_Integer )
|
||||
{
|
||||
return theML; // stub
|
||||
return *((AppDef_MultiLine*) 0);
|
||||
}
|
||||
|
||||
Standard_Boolean AppDef_MyLineTool::MakeMLOneMorePoint(const AppDef_MultiLine& ,
|
||||
|
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
//! Is never called in the algorithms.
|
||||
//! Nothing is done.
|
||||
Standard_EXPORT static AppDef_MultiLine MakeMLBetween (const AppDef_MultiLine& ML,
|
||||
Standard_EXPORT static AppDef_MultiLine& MakeMLBetween (const AppDef_MultiLine& ML,
|
||||
const Standard_Integer I1,
|
||||
const Standard_Integer I2,
|
||||
const Standard_Integer NbPMin);
|
||||
@@ -106,6 +106,27 @@ public:
|
||||
const Standard_Integer I2,
|
||||
const Standard_Integer indbad,
|
||||
AppDef_MultiLine& OtherLine);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AppDef_MyLineTool_HeaderFile
|
||||
|
@@ -50,7 +50,6 @@ Approx_ComputeCLine::Approx_ComputeCLine
|
||||
mycut = cutting;
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
myMaxSegments = IntegerLast();
|
||||
alldone = Standard_False;
|
||||
Perform(Line);
|
||||
}
|
||||
@@ -77,7 +76,6 @@ Approx_ComputeCLine::Approx_ComputeCLine
|
||||
mycut = cutting;
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
myMaxSegments = IntegerLast();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -93,11 +91,9 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||
Standard_Real thetol3d = Precision::Confusion(), thetol2d = Precision::Confusion();
|
||||
UFirst = Line.FirstParameter();
|
||||
ULast = Line.LastParameter();
|
||||
Standard_Real TolU = Max((ULast-UFirst)*1.e-05, Precision::PApproximation());
|
||||
Standard_Real TolU = (ULast-UFirst)*1.e-05;
|
||||
Standard_Real myfirstU = UFirst;
|
||||
Standard_Real mylastU = ULast;
|
||||
Standard_Integer aMaxSegments = 0;
|
||||
Standard_Integer aMaxSegments1 = myMaxSegments - 1;
|
||||
|
||||
if (!mycut)
|
||||
{
|
||||
@@ -130,8 +126,7 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||
// Calcul de la partie a approximer.
|
||||
myfirstU = mylastU;
|
||||
mylastU = ULast;
|
||||
if (Abs(ULast-myfirstU) <= RealEpsilon()
|
||||
|| aMaxSegments >= myMaxSegments)
|
||||
if (Abs(ULast-myfirstU) <= RealEpsilon())
|
||||
{
|
||||
Finish = Standard_True;
|
||||
alldone = Standard_True;
|
||||
@@ -160,15 +155,11 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||
|
||||
// Calcul des parametres sur ce nouvel intervalle.
|
||||
Ok = Compute(Line, myfirstU, mylastU, thetol3d, thetol2d);
|
||||
if(Ok)
|
||||
{
|
||||
aMaxSegments++;
|
||||
}
|
||||
|
||||
//cout << myfirstU << " - " << mylastU << " tol : " << thetol3d << " " << thetol2d << endl;
|
||||
|
||||
// is new decision better?
|
||||
if (!Ok && (Abs(myfirstU-mylastU) <= TolU || aMaxSegments >= aMaxSegments1))
|
||||
if (!Ok && Abs(myfirstU-mylastU) <= TolU)
|
||||
{
|
||||
Ok = Standard_True; // stop interval cutting, approx the rest part
|
||||
|
||||
@@ -185,7 +176,6 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||
|
||||
tolreached = Standard_False; // helas
|
||||
myMultiCurves.Append(KeptMultiCurve);
|
||||
aMaxSegments++;
|
||||
Tolers3d.Append (KeptT3d);
|
||||
Tolers2d.Append (KeptT2d);
|
||||
myfirstparam.Append (KeptUfirst);
|
||||
@@ -313,16 +303,6 @@ void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
|
||||
mylastC = LastC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaxSegments
|
||||
//purpose : Changes the max number of segments, which is allowed for cutting.
|
||||
//=======================================================================
|
||||
|
||||
void Approx_ComputeCLine:: SetMaxSegments(const Standard_Integer theMaxSegments)
|
||||
{
|
||||
myMaxSegments = theMaxSegments;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsAllApproximated
|
||||
//purpose : returns False if at a moment of the approximation,
|
||||
|
@@ -354,7 +354,6 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
|
||||
myC2D2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetCurve();
|
||||
mySurf2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetSurface();
|
||||
|
||||
Standard_FALLTHROUGH
|
||||
case 2:
|
||||
CurOnSur.Load(myC2D1);
|
||||
CurOnSur.Load(mySurf1);
|
||||
|
@@ -60,9 +60,6 @@ public:
|
||||
|
||||
//! Changes the constraints of the approximation.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
|
||||
|
||||
//! Changes the max number of segments, which is allowed for cutting.
|
||||
Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments);
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
@@ -117,7 +114,6 @@ private:
|
||||
Standard_Boolean mycut;
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
Standard_Integer myMaxSegments;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -60,9 +60,6 @@ public:
|
||||
|
||||
//! Changes the constraints of the approximation.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
|
||||
|
||||
//! Changes the max number of segments, which is allowed for cutting.
|
||||
Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments);
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
@@ -117,7 +114,6 @@ private:
|
||||
Standard_Boolean mycut;
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
Standard_Integer myMaxSegments;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -593,7 +593,7 @@ void BOPAlgo_BuilderFace::PerformAreas()
|
||||
// 5.2. Add unused holes to the original face
|
||||
if (aNbHoles != aNbInOutMap) {
|
||||
Bnd_Box aBoxF;
|
||||
BRepBndLib::AddOptimal(myFace, aBoxF, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(myFace, aBoxF);
|
||||
if (aBoxF.IsOpenXmin() || aBoxF.IsOpenXmax() ||
|
||||
aBoxF.IsOpenYmin() || aBoxF.IsOpenYmax() ||
|
||||
aBoxF.IsOpenZmin() || aBoxF.IsOpenZmax()) {
|
||||
@@ -810,6 +810,7 @@ Standard_Boolean IsInside(const TopoDS_Shape& theHole,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Real aT, aU, aV;
|
||||
|
||||
TopAbs_State aState;
|
||||
TopExp_Explorer aExp;
|
||||
@@ -823,19 +824,20 @@ Standard_Boolean IsInside(const TopoDS_Shape& theHole,
|
||||
BOPTools::MapShapes(aF2, TopAbs_EDGE, aME2);//AA
|
||||
//
|
||||
aExp.Init(theHole, TopAbs_EDGE);
|
||||
if (aExp.More())
|
||||
{
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge *) (&aExp.Current()));
|
||||
if (aME2.Contains(aE))
|
||||
{
|
||||
if (aExp.More()) {
|
||||
const TopoDS_Edge& aE =(*(TopoDS_Edge *)(&aExp.Current()));
|
||||
if (aME2.Contains(aE)) {
|
||||
return bRet;
|
||||
}
|
||||
if (!BRep_Tool::Degenerated(aE))
|
||||
{
|
||||
if (!BRep_Tool::Degenerated(aE)) {
|
||||
//
|
||||
gp_Pnt aP3D;
|
||||
BOPTools_AlgoTools::PointOnEdge(aE, BOPTools_AlgoTools2D::IntermediatePoint(aE), aP3D);
|
||||
bRet = theContext->IsPointInFace(aP3D, aF2, BRep_Tool::Tolerance(aE));
|
||||
aT=BOPTools_AlgoTools2D::IntermediatePoint(aE);
|
||||
BOPTools_AlgoTools2D::PointOnSurface(aE, aF2, aT, aU, aV, theContext);
|
||||
aP2D.SetCoord(aU, aV);
|
||||
//
|
||||
IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
|
||||
aState=aClsf.Perform(aP2D);
|
||||
bRet=(aState==TopAbs_IN);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
@@ -600,7 +600,7 @@ void BOPAlgo_BuilderSolid::PerformAreas()
|
||||
const TopoDS_Shape& aShell = aItLS.Value();
|
||||
aSB.SetShape(aShell);
|
||||
//
|
||||
BRepBndLib::AddOptimal(aShell, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aShell, aBox);
|
||||
bIsHole=Standard_False;
|
||||
//
|
||||
bIsGrowth=IsGrowthShell(aShell, aMHF);
|
||||
@@ -834,7 +834,7 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
|
||||
const BOPAlgo_FacePnt& aFP=aVFP(k);
|
||||
const TopoDS_Face& aF=aFP.Face();
|
||||
//
|
||||
BRepBndLib::AddOptimal(aF, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aF, aBox);
|
||||
aTreeFiller.Add(k, aBox);
|
||||
}
|
||||
//
|
||||
|
@@ -577,7 +577,7 @@ void BOPAlgo_Builder::FillIn3DParts
|
||||
continue;
|
||||
}
|
||||
Bnd_Box aBox;
|
||||
BRepBndLib::AddOptimal(aSx, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aSx, aBox);
|
||||
aBox.SetGap(aBox.GetGap() + Precision::Confusion());
|
||||
//
|
||||
BOPAlgo_ShapeBox& aSB=aVSB.Append1();
|
||||
|
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <BOPTools.hxx>
|
||||
@@ -40,9 +39,6 @@ static
|
||||
void MakeTypedContainers(const TopoDS_Shape& theSC,
|
||||
TopoDS_Shape& theResult);
|
||||
|
||||
static void CollectMaterialBoundaries(const BOPCol_ListOfShape& theLS,
|
||||
TopTools_MapOfShape& theMapKeepBnd);
|
||||
|
||||
//=======================================================================
|
||||
//function : empty constructor
|
||||
//purpose :
|
||||
@@ -271,8 +267,7 @@ void BOPAlgo_CellsBuilder::AddToResult(const BOPCol_ListOfShape& theLSToTake,
|
||||
BOPCol_ListIteratorOfListOfShape aItLP(aParts);
|
||||
for (; aItLP.More(); aItLP.Next()) {
|
||||
const TopoDS_Shape& aPart = aItLP.Value();
|
||||
// provide uniqueness of the parts
|
||||
if (aResParts.Add(aPart) && !myShapeMaterial.IsBound(aPart)) {
|
||||
if (aResParts.Add(aPart)) {
|
||||
BRep_Builder().Add(myShape, aPart);
|
||||
bChanged = Standard_True;
|
||||
}
|
||||
@@ -464,8 +459,6 @@ void BOPAlgo_CellsBuilder::RemoveInternalBoundaries()
|
||||
// try to remove the internal boundaries between the
|
||||
// shapes of the same material
|
||||
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfShape aItM(myMaterials);
|
||||
BOPCol_ListOfShape aLSUnify[2];
|
||||
TopTools_MapOfShape aKeepMap[2];
|
||||
for (; aItM.More(); aItM.Next()) {
|
||||
Standard_Integer iMaterial = aItM.Key();
|
||||
BOPCol_ListOfShape& aLS = aItM.ChangeValue();
|
||||
@@ -492,65 +485,34 @@ void BOPAlgo_CellsBuilder::RemoveInternalBoundaries()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (aItLS.More())
|
||||
{
|
||||
//
|
||||
BOPCol_ListOfShape aLSNew;
|
||||
if (aItLS.More()) {
|
||||
// add the warning
|
||||
TopoDS_Compound aMultiDimS;
|
||||
aBB.MakeCompound(aMultiDimS);
|
||||
aBB.Add(aMultiDimS, aLS.First());
|
||||
aBB.Add(aMultiDimS, aItLS.Value());
|
||||
AddWarning(new BOPAlgo_AlertRemovalOfIBForMDimShapes(aMultiDimS));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (aType == TopAbs_EDGE || aType == TopAbs_FACE)
|
||||
{
|
||||
// for edges and faces, just collect shapes to unify them later after exiting the loop;
|
||||
// collect boundaries of shapes of current material in the keep map
|
||||
Standard_Integer iType = (aType == TopAbs_EDGE ? 0 : 1);
|
||||
CollectMaterialBoundaries(aLS, aKeepMap[iType]);
|
||||
// save shapes to unify later
|
||||
BOPCol_ListOfShape aCopy(aLS);
|
||||
aLSUnify[iType].Append(aCopy);
|
||||
continue;
|
||||
TopoDS_Compound aMultiDimS;
|
||||
aBB.MakeCompound(aMultiDimS);
|
||||
aBB.Add(aMultiDimS, aLS.First());
|
||||
aBB.Add(aMultiDimS, aItLS.Value());
|
||||
//
|
||||
AddWarning (new BOPAlgo_AlertRemovalOfIBForMDimShapes (aMultiDimS));
|
||||
}
|
||||
else
|
||||
{
|
||||
// aType is Solid;
|
||||
// remove internal faces between solids of the same material just now
|
||||
BOPCol_ListOfShape aLSNew;
|
||||
if (RemoveInternals(aLS, aLSNew))
|
||||
{
|
||||
bChanged = Standard_True;
|
||||
// update materials maps
|
||||
for (aItLS.Initialize(aLSNew); aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aS = aItLS.Value();
|
||||
myShapeMaterial.Bind(aS, iMaterial);
|
||||
}
|
||||
aLS.Assign(aLSNew);
|
||||
}
|
||||
aLSNew.Assign(aLS);
|
||||
}
|
||||
else {
|
||||
if (RemoveInternals(aLS, aLSNew)) {
|
||||
bChanged = Standard_True;
|
||||
}
|
||||
}
|
||||
// add shapes to result (multidimensional and solids)
|
||||
for (aItLS.Initialize(aLS); aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aS = aItLS.Value();
|
||||
aBB.Add(aResult, aS);
|
||||
}
|
||||
}
|
||||
|
||||
// remove internal boundaries for edges and faces
|
||||
for (Standard_Integer iType = 0; iType < 2; ++iType)
|
||||
{
|
||||
if (aLSUnify[iType].IsEmpty())
|
||||
continue;
|
||||
BOPCol_ListOfShape aLSN;
|
||||
if (RemoveInternals(aLSUnify[iType], aLSN, aKeepMap[iType]))
|
||||
bChanged = Standard_True;
|
||||
// add shapes to result ([unified] edges or faces)
|
||||
for (BOPCol_ListIteratorOfListOfShape aItLS(aLSN); aItLS.More(); aItLS.Next()) {
|
||||
//
|
||||
// update materials maps and add new shapes to result
|
||||
aItLS.Initialize(aLSNew);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aS = aItLS.Value();
|
||||
aBB.Add(aResult, aS);
|
||||
if (!myShapeMaterial.IsBound(aS)) {
|
||||
myShapeMaterial.Bind(aS, iMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -758,8 +720,7 @@ void BOPAlgo_CellsBuilder::MakeContainers()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const BOPCol_ListOfShape& theLS,
|
||||
BOPCol_ListOfShape& theLSNew,
|
||||
const TopTools_MapOfShape& theMapKeepBnd)
|
||||
BOPCol_ListOfShape& theLSNew)
|
||||
{
|
||||
Standard_Boolean bRemoved = Standard_False;
|
||||
if (theLS.Extent() < 2) {
|
||||
@@ -789,8 +750,8 @@ Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const BOPCol_ListOfShape&
|
||||
//
|
||||
bFaces = (aType == TopAbs_FACE);
|
||||
bEdges = (aType == TopAbs_EDGE);
|
||||
//
|
||||
ShapeUpgrade_UnifySameDomain anUnify (aShape, bEdges, bFaces);
|
||||
anUnify.KeepShapes(theMapKeepBnd);
|
||||
anUnify.Build();
|
||||
const TopoDS_Shape& aSNew = anUnify.Shape();
|
||||
//
|
||||
@@ -822,15 +783,14 @@ Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const BOPCol_ListOfShape&
|
||||
aNb = aMG.Extent();
|
||||
for (i = 1; i <= aNb; ++i) {
|
||||
const TopoDS_Shape& aSS = aMG(i);
|
||||
const Standard_Integer* pMaterial = myShapeMaterial.Seek(aSS);
|
||||
const TopTools_ListOfShape& aLSMod = anUnify.History()->Modified(aSS);
|
||||
TopTools_ListIteratorOfListOfShape aIt(aLSMod);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSU = aIt.Value();
|
||||
myMapModified.Bind(aSS, aSU);
|
||||
bRemoved = Standard_True;
|
||||
if (pMaterial && !myShapeMaterial.IsBound(aSU))
|
||||
myShapeMaterial.Bind(aSU, *pMaterial);
|
||||
if (!aSU.IsNull() && !aSS.IsSame(aSU)) {
|
||||
myMapModified.Bind(aSS, aSU);
|
||||
bRemoved = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1113,33 +1073,6 @@ void MakeTypedContainers(const TopoDS_Shape& theSC,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CollectMaterialBoundaries
|
||||
//purpose : Add to theMapKeepBnd the boundary shapes of the area defined by shapes from the list
|
||||
//=======================================================================
|
||||
static void CollectMaterialBoundaries(const BOPCol_ListOfShape& theLS,
|
||||
TopTools_MapOfShape& theMapKeepBnd)
|
||||
{
|
||||
TopAbs_ShapeEnum aType = theLS.First().ShapeType();
|
||||
TopAbs_ShapeEnum aTypeSubsh = (aType == TopAbs_FACE ? TopAbs_EDGE : TopAbs_VERTEX);
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapSubSh;
|
||||
BOPCol_ListIteratorOfListOfShape anIt(theLS);
|
||||
for (; anIt.More(); anIt.Next())
|
||||
{
|
||||
const TopoDS_Shape& aS = anIt.Value();
|
||||
TopExp::MapShapesAndAncestors(aS, aTypeSubsh, aType, aMapSubSh);
|
||||
}
|
||||
for (int i = 1; i <= aMapSubSh.Extent(); i++)
|
||||
{
|
||||
// check if the subshape belongs to boundary of the area
|
||||
if (aMapSubSh(i).Extent() == 1)
|
||||
{
|
||||
// add to theMapKeepBnd
|
||||
theMapKeepBnd.Add(aMapSubSh.FindKey(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TypeToExplore
|
||||
//purpose :
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
#include <BOPAlgo_Builder.hxx>
|
||||
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
@@ -265,8 +265,7 @@ class BOPAlgo_CellsBuilder : public BOPAlgo_Builder
|
||||
//! Removes internal boundaries between cells with the same material.<br>
|
||||
//! Returns TRUE if any internal boundaries have been removed.
|
||||
Standard_EXPORT Standard_Boolean RemoveInternals(const BOPCol_ListOfShape& theLS,
|
||||
BOPCol_ListOfShape& theLSNew,
|
||||
const TopTools_MapOfShape& theMapKeepBnd = TopTools_MapOfShape());
|
||||
BOPCol_ListOfShape& theLSNew);
|
||||
|
||||
// fields
|
||||
TopoDS_Shape myAllParts;
|
||||
@@ -274,6 +273,9 @@ class BOPAlgo_CellsBuilder : public BOPAlgo_Builder
|
||||
BOPCol_DataMapOfIntegerListOfShape myMaterials;
|
||||
BOPCol_DataMapOfShapeInteger myShapeMaterial;
|
||||
BOPCol_DataMapOfShapeShape myMapModified;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif //_BOPAlgo_CellsBuilder_HeaderFile
|
||||
|
@@ -294,6 +294,8 @@ void BOPAlgo_PaveFiller::PerformInternal()
|
||||
//
|
||||
UpdateBlocksWithSharedVertices();
|
||||
//
|
||||
myDS->RefineFaceInfoIn();
|
||||
//
|
||||
MakeSplitEdges();
|
||||
if (HasErrors()) {
|
||||
return;
|
||||
|
@@ -97,7 +97,7 @@ void BOPAlgo_PaveFiller::UpdateEdgeTolerance (const Standard_Integer nE,
|
||||
const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(nE);
|
||||
aBB.UpdateEdge(aE, aTol);
|
||||
Bnd_Box& aBoxE=aSIE.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aE, aBoxE, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aE, aBoxE);
|
||||
aBoxE.SetGap(aBoxE.GetGap() + Precision::Confusion());
|
||||
//
|
||||
aIt.Initialize(aLI);
|
||||
@@ -113,7 +113,7 @@ void BOPAlgo_PaveFiller::UpdateEdgeTolerance (const Standard_Integer nE,
|
||||
aBB.UpdateVertex(aV, aTol);
|
||||
BOPDS_ShapeInfo& aSIV = myDS->ChangeShapeInfo(nV);
|
||||
Bnd_Box& aBoxV = aSIV.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aV, aBoxV, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aV, aBoxV);
|
||||
aBoxV.SetGap(aBoxV.GetGap() + Precision::Confusion());
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ Standard_Integer BOPAlgo_PaveFiller::UpdateVertex
|
||||
aBB.UpdateVertex(aVSD, aTolNew);
|
||||
BOPDS_ShapeInfo& aSIV = myDS->ChangeShapeInfo(nVNew);
|
||||
Bnd_Box& aBoxV = aSIV.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aVSD, aBoxV, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aVSD, aBoxV);
|
||||
aBoxV.SetGap(aBoxV.GetGap() + Precision::Confusion());
|
||||
}
|
||||
return nVNew;
|
||||
@@ -165,7 +165,7 @@ Standard_Integer BOPAlgo_PaveFiller::UpdateVertex
|
||||
// bounding box for the new vertex
|
||||
BOPDS_ShapeInfo& aSIDS = myDS->ChangeShapeInfo(nVNew);
|
||||
Bnd_Box& aBoxDS = aSIDS.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aVNew, aBoxDS, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aVNew, aBoxDS);
|
||||
aBoxDS.SetGap(aBoxDS.GetGap() + Precision::Confusion());
|
||||
//
|
||||
// add vertex to SD map
|
||||
|
@@ -630,7 +630,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV1);
|
||||
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
||||
aBoxDS = Bnd_Box();
|
||||
BRepBndLib::AddOptimal(aV, aBoxDS, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aV, aBoxDS);
|
||||
aBoxDS.SetGap(aBoxDS.GetGap() + Precision::Confusion());
|
||||
//
|
||||
if (aDMVLV.IsBound(nV1))
|
||||
@@ -680,9 +680,6 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
// into all faces, not participated in creation of that edge, as IN edge
|
||||
PutSEInOtherFaces();
|
||||
//
|
||||
|
||||
myDS->FilterOfCommonBlocks();
|
||||
|
||||
//-----------------------------------------------------scope t
|
||||
aMVStick.Clear();
|
||||
aMPBOnIn.Clear();
|
||||
@@ -1536,7 +1533,7 @@ void BOPAlgo_PaveFiller::PutBoundPaveOnCurve(const TopoDS_Face& aF1,
|
||||
//
|
||||
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVn);
|
||||
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aVn, aBoxDS, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aVn, aBoxDS);
|
||||
aBoxDS.SetGap(aBoxDS.GetGap() + Precision::Confusion());
|
||||
//
|
||||
aLVB.Append(nVn);
|
||||
@@ -2154,7 +2151,7 @@ void BOPAlgo_PaveFiller::PutPaveOnCurve
|
||||
//
|
||||
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV);
|
||||
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aV, aBoxDS, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aV, aBoxDS);
|
||||
aBoxDS.SetGap(aBoxDS.GetGap() + Precision::Confusion());
|
||||
}
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ class BOPAlgo_SplitEdge : public BOPAlgo_Algo {
|
||||
myV1, myT1,
|
||||
myV2, myT2,
|
||||
myESp);
|
||||
BRepBndLib::AddOptimal(myESp, myBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(myESp, myBox);
|
||||
myBox.SetGap(myBox.GetGap() + Precision::Confusion());
|
||||
}
|
||||
//
|
||||
@@ -525,7 +525,7 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
|
||||
aSI.SetShape(aSp);
|
||||
//
|
||||
Bnd_Box& aBox=aSI.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aSp, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aSp, aBox);
|
||||
aBox.SetGap(aBox.GetGap() + Precision::Confusion());
|
||||
//
|
||||
nSp=myDS->Append(aSI);
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
|
||||
#include <Geom2dInt_GInter.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
@@ -53,11 +52,6 @@ static
|
||||
const Standard_Real aP2,
|
||||
TopoDS_Edge& aNewEdge);
|
||||
|
||||
static
|
||||
Standard_Boolean AddSplitPoint(const Handle(BOPDS_PaveBlock)& thePBD,
|
||||
const BOPDS_Pave& thePave,
|
||||
const Standard_Real theTol);
|
||||
|
||||
//=======================================================================
|
||||
//function : ProcessDE
|
||||
//purpose :
|
||||
@@ -310,30 +304,25 @@ void BOPAlgo_PaveFiller::ProcessDE()
|
||||
}
|
||||
// Intersection
|
||||
Geom2dInt_GInter aGInter(aGAC1, aGAC2, aTolInt, aTolInt);
|
||||
if (aGInter.IsDone() && aGInter.NbPoints())
|
||||
{
|
||||
// Analyze intersection points
|
||||
Standard_Integer i, aNbPoints = aGInter.NbPoints();
|
||||
for (i = 1; i <= aNbPoints; ++i) {
|
||||
Standard_Real aX = aGInter.Point(i).ParamOnFirst();
|
||||
aPave.SetParameter(aX);
|
||||
AddSplitPoint(aPBD, aPave, aTolCmp);
|
||||
}
|
||||
if (!aGInter.IsDone()) {
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the intersection did not succeed, try the projection of the end point
|
||||
// of the curve corresponding to the vertex of degenerated edge
|
||||
Standard_Real aT = (nVD == aPB->Pave1().Index() ?
|
||||
aPB->Pave1().Parameter() : aPB->Pave2().Parameter());
|
||||
gp_Pnt2d aP2d = aC2D->Value(aT);
|
||||
Geom2dAPI_ProjectPointOnCurve aProj2d(aP2d, aC2DDE, aTD1, aTD2);
|
||||
if (aProj2d.NbPoints())
|
||||
{
|
||||
Standard_Real aX = aProj2d.LowerDistanceParameter();
|
||||
aPave.SetParameter(aX);
|
||||
AddSplitPoint(aPBD, aPave, aTolCmp);
|
||||
//
|
||||
// Analyze intersection points
|
||||
Standard_Integer i, aNbPoints = aGInter.NbPoints();
|
||||
for (i = 1; i <= aNbPoints; ++i) {
|
||||
Standard_Real aX = aGInter.Point(i).ParamOnFirst();
|
||||
if (aX - aTD1 < aTolCmp || aTD2 - aX < aTolCmp) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
Standard_Integer anInd;
|
||||
if (aPBD->ContainsParameter(aX, aTolCmp, anInd)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aPave.SetParameter(aX);
|
||||
aPBD->AppendExtPave1(aPave);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,34 +354,3 @@ void BOPAlgo_PaveFiller::ProcessDE()
|
||||
BB.UpdateEdge(E, aTol);
|
||||
aNewEdge=E;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: AddSplitPoint
|
||||
// purpose: Validates the point represented by the pave <thePave>
|
||||
// for the Pave Block <thePBD>.
|
||||
// In case the point passes the checks it is added as an
|
||||
// Extra Pave to the Pave Block for further splitting of the latter.
|
||||
// Returns TRUE if the point is added, otherwise returns FALSE.
|
||||
//=======================================================================
|
||||
Standard_Boolean AddSplitPoint(const Handle(BOPDS_PaveBlock)& thePBD,
|
||||
const BOPDS_Pave& thePave,
|
||||
const Standard_Real theTol)
|
||||
{
|
||||
Standard_Real aTD1, aTD2;
|
||||
thePBD->Range(aTD1, aTD2);
|
||||
|
||||
Standard_Real aT = thePave.Parameter();
|
||||
// Check that the parameter is inside the Pave Block
|
||||
if (aT - aTD1 < theTol || aTD2 - aT < theTol)
|
||||
return Standard_False;
|
||||
|
||||
// Check that the pave block does not contain the same parameter
|
||||
Standard_Integer anInd;
|
||||
if (thePBD->ContainsParameter(aT, theTol, anInd))
|
||||
return Standard_False;
|
||||
|
||||
// Add the point as an Extra pave to the Pave Block for further
|
||||
// splitting of the latter
|
||||
thePBD->AppendExtPave1(thePave);
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -19,8 +19,6 @@
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <OSD_Parallel.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Standard_Mutex.hxx>
|
||||
#include <OSD_Thread.hxx>
|
||||
|
||||
//
|
||||
// 1. Implementation of Functors/Starters
|
||||
|
@@ -463,7 +463,7 @@ void BOPDS_DS::Init(const Standard_Real theFuzz)
|
||||
}
|
||||
//
|
||||
Bnd_Box& aBox=aSI.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aE, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aE, aBox);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLV=aSI.SubShapes();
|
||||
aIt1.Initialize(aLV);
|
||||
@@ -490,7 +490,7 @@ void BOPDS_DS::Init(const Standard_Real theFuzz)
|
||||
const TopoDS_Shape& aS=aSI.Shape();
|
||||
//
|
||||
Bnd_Box& aBox=aSI.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aS, aBox, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aS, aBox);
|
||||
//
|
||||
BOPCol_ListOfInteger& aLW=aSI.ChangeSubShapes();
|
||||
aIt1.Initialize(aLW);
|
||||
@@ -1418,6 +1418,44 @@ void BOPDS_DS::RefineFaceInfoOn()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RefineFaceInfoIn
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_DS::RefineFaceInfoIn()
|
||||
{
|
||||
for (Standard_Integer i = 0; i < myNbSourceShapes; ++i)
|
||||
{
|
||||
const BOPDS_ShapeInfo& aSI = ShapeInfo(i);
|
||||
if (aSI.ShapeType() != TopAbs_FACE)
|
||||
continue;
|
||||
|
||||
if (!aSI.HasReference())
|
||||
continue;
|
||||
|
||||
BOPDS_FaceInfo& aFI = ChangeFaceInfo(i);
|
||||
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBOn = aFI.PaveBlocksOn();
|
||||
BOPDS_IndexedMapOfPaveBlock& aMPBIn = aFI.ChangePaveBlocksIn();
|
||||
|
||||
if (aMPBIn.IsEmpty() || aMPBOn.IsEmpty())
|
||||
continue;
|
||||
|
||||
BOPDS_IndexedMapOfPaveBlock aMPBInNew;
|
||||
|
||||
const Standard_Integer aNbPBIn = aMPBIn.Extent();
|
||||
for (Standard_Integer j = 1; j <= aNbPBIn; ++j)
|
||||
{
|
||||
if (!aMPBOn.Contains(aMPBIn(j)))
|
||||
aMPBInNew.Add(aMPBIn(j));
|
||||
}
|
||||
|
||||
if (aMPBInNew.Extent() < aNbPBIn)
|
||||
aMPBIn = aMPBInNew;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AloneVertices
|
||||
//purpose :
|
||||
@@ -1786,7 +1824,7 @@ void BOPDS_DS::UpdateEdgeTolerance(const Standard_Integer nE,
|
||||
aBB.UpdateEdge(aE, aTol);
|
||||
BOPDS_ShapeInfo& aSIE=ChangeShapeInfo(nE);
|
||||
Bnd_Box& aBoxE=aSIE.ChangeBox();
|
||||
BRepBndLib::AddOptimal(aE, aBoxE, Standard_True, Standard_True);
|
||||
BRepBndLib::Add(aE, aBoxE);
|
||||
aBoxE.SetGap(aBoxE.GetGap() + aTolAdd);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI = aSIE.SubShapes();
|
||||
@@ -2106,43 +2144,4 @@ Standard_Boolean BOPDS_DS::IsValidShrunkData(const Handle(BOPDS_PaveBlock)& theP
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FilterOfCommonBlocks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_DS::FilterOfCommonBlocks()
|
||||
{
|
||||
NCollection_DataMap<TopoDS_Edge, Handle(BOPDS_CommonBlock)> aMapEC;
|
||||
BOPDS_VectorOfListOfPaveBlock& aPBP = ChangePaveBlocksPool();
|
||||
Standard_Integer aNbPBP = aPBP.Extent();
|
||||
//
|
||||
for (Standard_Integer i = 0; i < aNbPBP; ++i)
|
||||
{
|
||||
BOPDS_ListOfPaveBlock& aLPB = aPBP(i);
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItPB;
|
||||
aItPB.Initialize(aLPB);
|
||||
for (; aItPB.More(); aItPB.Next())
|
||||
{
|
||||
const Handle(BOPDS_PaveBlock) &aPB = aItPB.Value();
|
||||
|
||||
if (!IsCommonBlock(aPB))
|
||||
continue;
|
||||
|
||||
const Standard_Integer anEIdx = aPB->Edge();
|
||||
const TopoDS_Edge &anE = TopoDS::Edge(Shape(anEIdx));
|
||||
|
||||
Handle(BOPDS_CommonBlock) *aCB = aMapEC.ChangeSeek(anE);
|
||||
if (!aCB)
|
||||
{
|
||||
aCB = aMapEC.Bound(anE, CommonBlock(aPB));
|
||||
continue;
|
||||
}
|
||||
|
||||
myMapPBCB.UnBind(aPB);
|
||||
(*aCB)->AddPaveBlock(aPB);
|
||||
SetCommonBlock(aPB, *aCB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -302,6 +302,9 @@ Standard_EXPORT virtual ~BOPDS_DS();
|
||||
//! ++
|
||||
Standard_EXPORT void RefineFaceInfoOn();
|
||||
|
||||
//! Removes faces with state ON from the
|
||||
//! list of IN-faces
|
||||
Standard_EXPORT void RefineFaceInfoIn();
|
||||
|
||||
//! Returns information about ON/IN subshapes of the given faces.
|
||||
//! @param theMVOnIn the indices of ON/IN vertices from both faces
|
||||
@@ -468,9 +471,6 @@ Standard_EXPORT virtual ~BOPDS_DS();
|
||||
//! of the existing vertices have been increased.
|
||||
Standard_EXPORT Standard_Boolean IsValidShrunkData(const Handle(BOPDS_PaveBlock)& thePB);
|
||||
|
||||
//! Combines the common-blocks and removes excess common-blocks
|
||||
Standard_EXPORT void FilterOfCommonBlocks();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
@@ -1657,10 +1657,6 @@ Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
if(aLCEFx.IsEmpty())
|
||||
return Standard_False;
|
||||
|
||||
// F2
|
||||
BOPTools_AlgoTools::GetFaceOff(aE1, aF1, aLCEFx, aF2, theContext);
|
||||
//
|
||||
@@ -1892,8 +1888,6 @@ Standard_Boolean GetFaceDir(const TopoDS_Edge& aE,
|
||||
bFound = BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge
|
||||
(aE, aF, aT, aDt, aPx, aDN, theContext);
|
||||
aProjPL.Perform(aPx);
|
||||
Standard_ASSERT_RETURN(aProjPL.IsDone(),
|
||||
"GetFaceDir: Project point on plane is failed", Standard_False);
|
||||
aPx = aProjPL.NearestPoint();
|
||||
gp_Vec aVec(aP, aPx);
|
||||
aDB.SetXYZ(aVec.XYZ());
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomInt.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
@@ -629,13 +630,11 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
Handle(GeomAdaptor_HCurve) aBAHC = new GeomAdaptor_HCurve(aC3D, aT1, aT2);
|
||||
//
|
||||
Standard_Real aTolR;
|
||||
Standard_Real aTR = Precision::Confusion();//1.e-7;
|
||||
Standard_Real aMaxTol = 1.e3 * aTR; //0.0001
|
||||
Standard_Boolean isAnaSurf = ProjLib::IsAnaSurf(aBAHS);
|
||||
|
||||
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
||||
if (pBAS->GetType() == GeomAbs_SurfaceOfRevolution)
|
||||
{
|
||||
if (pBAS->GetType() == GeomAbs_SurfaceOfRevolution) {
|
||||
Standard_Real aTR;
|
||||
//
|
||||
aTR=Precision::Confusion();//1.e-7;
|
||||
if (TolReached2d > aTR) {
|
||||
aTR=TolReached2d;
|
||||
}
|
||||
@@ -644,44 +643,23 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
ProjLib::MakePCurveOfType(aProj1, aC2D);
|
||||
aTolR = aProj1.GetTolerance();
|
||||
}
|
||||
else
|
||||
{
|
||||
ProjLib_ProjectedCurve aProjCurv(aBAHS);
|
||||
Standard_Integer aDegMin = -1, aDegMax = -1, aMaxSegments = -1;
|
||||
Standard_Real aMaxDist = -1;
|
||||
AppParCurves_Constraint aBndPnt = AppParCurves_TangencyPoint;
|
||||
if ((TolReached2d >= 10. * aTR) && (TolReached2d <= aMaxTol || isAnaSurf))
|
||||
{
|
||||
aTR = Min(aMaxTol, 0.1*TolReached2d);
|
||||
aMaxSegments = 100;
|
||||
aMaxDist = 1.e3*TolReached2d;
|
||||
if(!isAnaSurf)
|
||||
{
|
||||
aBndPnt = AppParCurves_PassPoint;
|
||||
}
|
||||
}
|
||||
else if(TolReached2d > aMaxTol)
|
||||
{
|
||||
aTR = Min(TolReached2d, 1.e3 * aMaxTol);
|
||||
aMaxDist = 1.e2 * aTR;
|
||||
aMaxSegments = 100;
|
||||
}
|
||||
aProjCurv.Load(aTR);
|
||||
aProjCurv.SetDegree(aDegMin, aDegMax);
|
||||
aProjCurv.SetMaxSegments(aMaxSegments);
|
||||
aProjCurv.SetBndPnt(aBndPnt);
|
||||
aProjCurv.SetMaxDist(aMaxDist);
|
||||
aProjCurv.Perform(aBAHC);
|
||||
else {
|
||||
ProjLib_ProjectedCurve aProjCurv(aBAHS, aBAHC);// 1
|
||||
ProjLib::MakePCurveOfType(aProjCurv, aC2D);
|
||||
aTolR=aProjCurv.GetTolerance();
|
||||
}
|
||||
//
|
||||
if (aC2D.IsNull() && (aTR < aMaxTol || aTR < TolReached2d))
|
||||
{
|
||||
aTR = Max(TolReached2d, aMaxTol);
|
||||
ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, aTR);// 2
|
||||
if (aC2D.IsNull()) {
|
||||
ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, TolReached2d);// 2
|
||||
ProjLib::MakePCurveOfType(aProjCurvAgain, aC2D);
|
||||
aTolR = aProjCurvAgain.GetTolerance();
|
||||
//
|
||||
if (aC2D.IsNull()) {
|
||||
Standard_Real aTR=0.0001;
|
||||
ProjLib_ProjectedCurve aProj3(aBAHS, aBAHC, aTR);// 3
|
||||
ProjLib::MakePCurveOfType(aProj3, aC2D);
|
||||
aTolR = aProj3.GetTolerance();
|
||||
}
|
||||
}
|
||||
//
|
||||
if(aC2D.IsNull())
|
||||
@@ -690,12 +668,25 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
}
|
||||
//
|
||||
TolReached2d=aTolR;
|
||||
//
|
||||
|
||||
// Adjust curve for periodic surface
|
||||
Handle(Geom2d_Curve) aC2DA;
|
||||
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA);
|
||||
//
|
||||
aC2D=aC2DA;
|
||||
//
|
||||
aC2D = aC2DA;
|
||||
|
||||
// Make sure that the range of the 2D curve is sufficient for representation of the 3D curve.
|
||||
Standard_Real aTCFirst = aC2D->FirstParameter();
|
||||
Standard_Real aTCLast = aC2D->LastParameter();
|
||||
if ((aTCFirst - aT1) > Precision::PConfusion() ||
|
||||
(aT2 - aTCLast ) > Precision::PConfusion())
|
||||
{
|
||||
if (aTCFirst < aT1) aTCFirst = aT1;
|
||||
if (aTCLast > aT2) aTCLast = aT2;
|
||||
|
||||
GeomLib::SameRange(Precision::PConfusion(), aC2D,
|
||||
aTCFirst, aTCLast, aT1, aT2, aC2D);
|
||||
}
|
||||
|
||||
// compute the appropriate tolerance for the edge
|
||||
Handle(Geom_Surface) aS = pBAS->Surface().Surface();
|
||||
aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf()));
|
||||
|
@@ -51,7 +51,6 @@
|
||||
#include <BRep_ListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointOnCurve.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepBuilderAPI_BndBoxTreeSelector.hxx>
|
||||
#include <BRepBuilderAPI_CellFilter.hxx>
|
||||
@@ -962,22 +961,11 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
|
||||
if (dist > dist2)
|
||||
dist2 = dist;
|
||||
}
|
||||
maxTol = Max(sqrt(dist2) * (1. + 1e-7), Precision::Confusion());
|
||||
}
|
||||
}
|
||||
if (maxTol >= 0. && maxTol < tolReached)
|
||||
{
|
||||
if (tolReached > MaxTolerance())
|
||||
{
|
||||
// Set tolerance directly to overwrite too large tolerance
|
||||
static_cast<BRep_TEdge*>(edge.TShape().get())->Tolerance(maxTol);
|
||||
}
|
||||
else
|
||||
{
|
||||
// just update tolerance with computed distance
|
||||
aBuilder.UpdateEdge(edge, maxTol);
|
||||
maxTol = Max(sqrt(dist2), Precision::Confusion());
|
||||
}
|
||||
}
|
||||
if(maxTol >= 0. && maxTol < tolReached)
|
||||
aBuilder.UpdateEdge(edge, maxTol);
|
||||
aBuilder.SameParameter(edge,Standard_True);
|
||||
}
|
||||
}
|
||||
|
@@ -47,9 +47,9 @@ static
|
||||
Standard_Real GetAddToParam(const gp_Lin& L,const Standard_Real P,const Bnd_Box& B);
|
||||
|
||||
//gets transition of line <L> passing through/near the edge <e> of faces <f1>, <f2>. <param> is
|
||||
// a parameter on the edge where the minimum distance between <l> and <e> was found
|
||||
static Standard_Integer GetTransi(const TopoDS_Face& f1, const TopoDS_Face& f2, const TopoDS_Edge e,
|
||||
Standard_Real param, const gp_Lin& L, IntCurveSurface_TransitionOnCurve& trans);
|
||||
// a parameter on the edge where the minimum distance between <l> and <e> was found
|
||||
static Standard_Integer GetTransi(const TopoDS_Face& f1, const TopoDS_Face& f2, const TopoDS_Edge e,
|
||||
Standard_Real param, const Geom_Line& L, IntCurveSurface_TransitionOnCurve& trans);
|
||||
|
||||
static Standard_Boolean GetNormalOnFaceBound(const TopoDS_Edge& E, const TopoDS_Face& F, Standard_Real param, gp_Dir& OutDir);
|
||||
|
||||
@@ -560,7 +560,7 @@ static Standard_Integer GetTransi(const TopoDS_Face& f1,
|
||||
const TopoDS_Face& f2,
|
||||
const TopoDS_Edge e,
|
||||
const Standard_Real param,
|
||||
const gp_Lin& L,
|
||||
const Geom_Line& L,
|
||||
IntCurveSurface_TransitionOnCurve& trans)
|
||||
{
|
||||
//return statuses:
|
||||
@@ -573,7 +573,7 @@ static Standard_Integer GetTransi(const TopoDS_Face& f1,
|
||||
if (!GetNormalOnFaceBound(e, f2, param, nf2))
|
||||
return -1;
|
||||
|
||||
const gp_Dir& LDir = L.Direction();
|
||||
const gp_Dir& LDir = L.Lin().Direction();
|
||||
|
||||
if(Abs(LDir.Dot(nf1)) < Precision::Angular() || Abs(LDir.Dot(nf2)) < Precision::Angular())
|
||||
{
|
||||
@@ -627,4 +627,4 @@ static void Trans(const Standard_Real parmin,
|
||||
state = 3; // IN
|
||||
else
|
||||
state = 4; // OUT
|
||||
}
|
||||
}
|
@@ -61,9 +61,6 @@ public:
|
||||
//! Changes the constraints of the approximation.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
|
||||
|
||||
//! Changes the max number of segments, which is allowed for cutting.
|
||||
Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments);
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
@@ -117,7 +114,7 @@ private:
|
||||
Standard_Boolean mycut;
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
Standard_Integer myMaxSegments;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@@ -102,40 +102,6 @@ static Standard_Boolean UpdateMap(const TopoDS_Shape& theKey,
|
||||
return !found;
|
||||
}
|
||||
|
||||
static void ReverseModifiedEdges(TopoDS_Shape& aShape,
|
||||
TopTools_MapOfShape& Emap)
|
||||
{
|
||||
TopExp_Explorer Explo(aShape, TopAbs_FACE);
|
||||
BRep_Builder BB;
|
||||
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
TopoDS_Shape aFace = Explo.Current();
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
TopoDS_Shape aWire = itf.Value();
|
||||
TopTools_ListOfShape Ledges;
|
||||
TopoDS_Iterator itw(aWire);
|
||||
for (; itw.More(); itw.Next())
|
||||
Ledges.Append(itw.Value());
|
||||
|
||||
aWire.Free(Standard_True);
|
||||
TopTools_ListIteratorOfListOfShape itl(Ledges);
|
||||
for (; itl.More(); itl.Next())
|
||||
BB.Remove(aWire, itl.Value());
|
||||
|
||||
for (itl.Initialize(Ledges); itl.More(); itl.Next())
|
||||
{
|
||||
TopoDS_Shape anEdge = itl.Value();
|
||||
if (Emap.Contains(anEdge))
|
||||
anEdge.Reverse();
|
||||
BB.Add(aWire, anEdge);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateTolFromTopOrBottomPCurve(const TopoDS_Face& aFace,
|
||||
TopoDS_Edge& anEdge)
|
||||
{
|
||||
@@ -739,9 +705,6 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
|
||||
result = MkSw.Shape();
|
||||
UpdateMap(TheS.Located(myProfile.Location()), result, myGenMap);
|
||||
myErrorOnSurf = MkSw.ErrorOnSurface();
|
||||
//Correct <myFirst> and <myLast>
|
||||
ReverseModifiedEdges(myFirst, myReversedEdges);
|
||||
ReverseModifiedEdges(myLast, myReversedEdges);
|
||||
|
||||
// Labeling of elements
|
||||
if (mySections.IsNull()) {
|
||||
|
@@ -583,28 +583,15 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
|
||||
//=======================================================================
|
||||
void BRepFill_PipeShell::DeleteProfile(const TopoDS_Shape& Profile)
|
||||
{
|
||||
Standard_Boolean isVertex = (Profile.ShapeType() == TopAbs_VERTEX);
|
||||
|
||||
Standard_Boolean Trouve=Standard_False;
|
||||
Standard_Integer ii;
|
||||
for (ii=1; ii<=mySeq.Length() && !Trouve; ii++) {
|
||||
Standard_Boolean found = Standard_False;
|
||||
const TopoDS_Wire& aWire = mySeq.Value(ii).Wire();
|
||||
if (isVertex)
|
||||
{
|
||||
TopExp_Explorer Explo(aWire, TopAbs_VERTEX);
|
||||
for (; Explo.More(); Explo.Next())
|
||||
if (Profile.IsSame(Explo.Current()))
|
||||
found = Standard_True;
|
||||
}
|
||||
else if (Profile.IsSame(aWire))
|
||||
found = Standard_True;
|
||||
|
||||
if (found)
|
||||
{
|
||||
Trouve = Standard_True;
|
||||
mySeq.Remove(ii);
|
||||
}
|
||||
const TopoDS_Shape& aSection = mySeq.Value(ii).OriginalShape();
|
||||
if (Profile.IsSame(aSection))
|
||||
{
|
||||
Trouve = Standard_True;
|
||||
mySeq.Remove(ii);
|
||||
}
|
||||
}
|
||||
|
||||
if (Trouve) mySection.Nullify();
|
||||
@@ -705,7 +692,7 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
|
||||
//function : Build
|
||||
//purpose : Construct the Shell and the history
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepFill_PipeShell::Build()
|
||||
Standard_Boolean BRepFill_PipeShell::Build()
|
||||
{
|
||||
Standard_Boolean Ok;
|
||||
Standard_Real FirstS, LastS;
|
||||
@@ -759,8 +746,9 @@ void BRepFill_PipeShell::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
|
||||
MkSw.SetTolerance(myTol3d, myBoundTol, 1.e-5, myTolAngular);
|
||||
MkSw.SetAngularControl(angmin, angmax);
|
||||
MkSw.SetForceApproxC1(myForceApproxC1);
|
||||
MkSw.SetBounds(TopoDS::Wire(myFirst),
|
||||
TopoDS::Wire(myLast));
|
||||
MkSw.SetBounds(TopoDS::Wire(myFirst),
|
||||
TopoDS::Wire(myLast));
|
||||
|
||||
GeomAbs_Shape theContinuity = GeomAbs_C2;
|
||||
if (myTrihedron == GeomFill_IsDiscreteTrihedron)
|
||||
theContinuity = GeomAbs_C0;
|
||||
@@ -914,13 +902,9 @@ const TopoDS_Shape& BRepFill_PipeShell::LastShape() const
|
||||
//function : Generated
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
// void BRepFill_PipeShell::Generated(const TopoDS_Shape& ,
|
||||
// TopTools_ListOfShape& )
|
||||
void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
|
||||
TopTools_ListOfShape& theList)
|
||||
{
|
||||
// throw Standard_NotImplemented("Generated:Pas Fait");
|
||||
|
||||
theList.Clear();
|
||||
|
||||
if(myGenMap.IsBound(theShape)) {
|
||||
@@ -1197,9 +1181,6 @@ void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
|
||||
Sec.WithCorrection());
|
||||
TopoDS_Wire TmpWire = Sec.Wire();
|
||||
aTrsf = Place.Transformation();
|
||||
//TopLoc_Location Loc2(Place.Transformation()), Loc1;
|
||||
//Loc1 = TmpWire.Location();
|
||||
//W.Location(Loc2.Multiplied(Loc1));
|
||||
//Transform the copy
|
||||
W = TopoDS::Wire(BRepBuilderAPI_Transform(TmpWire, aTrsf, Standard_True));
|
||||
////////////////////////////////////
|
||||
@@ -1240,37 +1221,40 @@ void BRepFill_PipeShell::BuildHistory(const BRepFill_Sweep& theSweep)
|
||||
TopoDS_Iterator itw;
|
||||
for (indw = 1; indw <= mySeq.Length(); indw++)
|
||||
{
|
||||
const TopoDS_Wire& aSection = mySeq(indw).Wire();
|
||||
const TopoDS_Shape& Section = mySeq(indw).OriginalShape();
|
||||
TopoDS_Wire aSection;
|
||||
Standard_Boolean IsPunctual = mySeq(indw).IsPunctual();
|
||||
if (IsPunctual)
|
||||
{
|
||||
//for punctual sections (first or last)
|
||||
//we take all the wires generated along the path
|
||||
TopExp_Explorer Explo(aSection, TopAbs_VERTEX);
|
||||
const TopoDS_Shape& VerSection = Explo.Current();
|
||||
|
||||
TopTools_ListOfShape Elist;
|
||||
for (Standard_Integer i = 1; i <= anUEdges->UpperRow(); i++)
|
||||
for (Standard_Integer j = 1; j <= anUEdges->UpperCol(); j++)
|
||||
Elist.Append(anUEdges->Value(i,j));
|
||||
myGenMap.Bind(VerSection, Elist);
|
||||
myGenMap.Bind(Section, Elist);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
aSection = TopoDS::Wire(Section);
|
||||
//Take the real index of section on the path
|
||||
Standard_Integer IndOfW = myIndOfSec(indw);
|
||||
const TopoDS_Wire& theWire = TopoDS::Wire(WSeq(IndOfW));
|
||||
BRepTools_WireExplorer wexp_sec(aSection);
|
||||
for (inde = 1; wexp_sec.More(); wexp_sec.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(wexp_sec.Current());
|
||||
const TopoDS_Edge& anOriginalEdge = TopoDS::Edge(wexp_sec.Current());
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(mySeq(indw).ModifiedShape(anOriginalEdge));
|
||||
if (BRep_Tool::Degenerated(anEdge))
|
||||
continue;
|
||||
|
||||
TopoDS_Shell aShell;
|
||||
BB.MakeShell(aShell);
|
||||
TopoDS_Vertex aVertex [2];
|
||||
TopExp::Vertices(anEdge, aVertex[0], aVertex[1]);
|
||||
TopExp::Vertices(anOriginalEdge, aVertex[0], aVertex[1]);
|
||||
Standard_Integer SignOfAnEdge =
|
||||
(anEdge.Orientation() == TopAbs_FORWARD)? 1 : -1;
|
||||
(anOriginalEdge.Orientation() == TopAbs_FORWARD)? 1 : -1;
|
||||
|
||||
//For each non-degenerated inde-th edge of <aSection>
|
||||
//we find inde-th edge in <theWire>
|
||||
@@ -1422,7 +1406,7 @@ void BRepFill_PipeShell::BuildHistory(const BRepFill_Sweep& theSweep)
|
||||
|
||||
TopTools_ListOfShape ListShell;
|
||||
ListShell.Append(aShell);
|
||||
myGenMap.Bind(anEdge, ListShell);
|
||||
myGenMap.Bind(anOriginalEdge, ListShell);
|
||||
////////////////////////
|
||||
|
||||
inde++;
|
||||
|
@@ -168,6 +168,10 @@ public:
|
||||
Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Sections);
|
||||
|
||||
//! Builds the resulting shape (redefined from MakeShape).
|
||||
//! If theIsToCheckValidity == FALSE then BRepFill_Sweep algorithm
|
||||
//! is allowed to create invalid faces (having self-interferences).
|
||||
//! It is considered for them that such faces will be processed and
|
||||
//! fixed by the high-level algorithms
|
||||
Standard_EXPORT Standard_Boolean Build();
|
||||
|
||||
//! Transform the sweeping Shell in Solid.
|
||||
|
@@ -22,6 +22,9 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <ShapeUpgrade_RemoveLocations.hxx>
|
||||
|
||||
BRepFill_Section::BRepFill_Section() :islaw(0),
|
||||
ispunctual(0),
|
||||
@@ -41,12 +44,19 @@ BRepFill_Section::BRepFill_Section(const TopoDS_Shape& Profile,
|
||||
contact(WithContact),
|
||||
correction(WithCorrection)
|
||||
{
|
||||
if (Profile.ShapeType() == TopAbs_WIRE)
|
||||
wire = TopoDS::Wire(Profile);
|
||||
else if (Profile.ShapeType() == TopAbs_VERTEX)
|
||||
myOriginalShape = Profile;
|
||||
|
||||
ShapeUpgrade_RemoveLocations RemLoc;
|
||||
RemLoc.SetRemoveLevel(TopAbs_COMPOUND);
|
||||
RemLoc.Remove(Profile);
|
||||
TopoDS_Shape aProfile = RemLoc.GetResult();
|
||||
|
||||
if (aProfile.ShapeType() == TopAbs_WIRE)
|
||||
wire = TopoDS::Wire(aProfile);
|
||||
else if (aProfile.ShapeType() == TopAbs_VERTEX)
|
||||
{
|
||||
ispunctual = Standard_True;
|
||||
TopoDS_Vertex aVertex = TopoDS::Vertex(Profile);
|
||||
TopoDS_Vertex aVertex = TopoDS::Vertex(aProfile);
|
||||
BRep_Builder BB;
|
||||
|
||||
TopoDS_Edge DegEdge;
|
||||
@@ -67,3 +77,58 @@ void BRepFill_Section::Set(const Standard_Boolean IsLaw)
|
||||
{
|
||||
islaw = IsLaw;
|
||||
}
|
||||
|
||||
TopoDS_Shape BRepFill_Section::ModifiedShape(const TopoDS_Shape& theShape) const
|
||||
{
|
||||
TopoDS_Shape aModifiedShape;
|
||||
|
||||
switch (theShape.ShapeType())
|
||||
{
|
||||
case TopAbs_WIRE:
|
||||
if (theShape.IsSame(myOriginalShape))
|
||||
aModifiedShape = wire;
|
||||
break;
|
||||
case TopAbs_EDGE:
|
||||
{
|
||||
TopoDS_Iterator itor(myOriginalShape);
|
||||
TopoDS_Iterator itw(wire);
|
||||
for (; itor.More(); itor.Next(),itw.Next())
|
||||
{
|
||||
const TopoDS_Shape& anOriginalEdge = itor.Value();
|
||||
const TopoDS_Shape& anEdge = itw.Value();
|
||||
if (anOriginalEdge.IsSame(theShape))
|
||||
{
|
||||
aModifiedShape = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TopAbs_VERTEX:
|
||||
if (theShape.IsSame(myOriginalShape))
|
||||
{
|
||||
TopExp_Explorer Explo(wire, TopAbs_VERTEX);
|
||||
aModifiedShape = Explo.Current();
|
||||
}
|
||||
else
|
||||
{
|
||||
TopExp_Explorer ExpOrig(myOriginalShape, TopAbs_VERTEX);
|
||||
TopExp_Explorer ExpWire(wire, TopAbs_VERTEX);
|
||||
for (; ExpOrig.More(); ExpOrig.Next(),ExpWire.Next())
|
||||
{
|
||||
const TopoDS_Shape& anOriginalVertex = ExpOrig.Current();
|
||||
const TopoDS_Shape& aVertex = ExpWire.Current();
|
||||
if (anOriginalVertex.IsSame(theShape))
|
||||
{
|
||||
aModifiedShape = aVertex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return aModifiedShape;
|
||||
}
|
||||
|
@@ -43,10 +43,14 @@ public:
|
||||
|
||||
Standard_EXPORT void Set (const Standard_Boolean IsLaw);
|
||||
|
||||
const TopoDS_Shape& OriginalShape() const;
|
||||
|
||||
const TopoDS_Wire& Wire() const;
|
||||
|
||||
const TopoDS_Vertex& Vertex() const;
|
||||
|
||||
Standard_EXPORT TopoDS_Shape ModifiedShape(const TopoDS_Shape& theShape) const;
|
||||
|
||||
Standard_Boolean IsLaw() const;
|
||||
|
||||
Standard_Boolean IsPunctual() const;
|
||||
@@ -68,6 +72,7 @@ private:
|
||||
|
||||
|
||||
|
||||
TopoDS_Shape myOriginalShape;
|
||||
TopoDS_Wire wire;
|
||||
TopoDS_Vertex vertex;
|
||||
Standard_Boolean islaw;
|
||||
|
@@ -14,6 +14,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline const TopoDS_Shape& BRepFill_Section::OriginalShape() const
|
||||
{
|
||||
return myOriginalShape;
|
||||
}
|
||||
|
||||
inline const TopoDS_Wire& BRepFill_Section::Wire() const
|
||||
{
|
||||
return wire;
|
||||
|
@@ -366,6 +366,56 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
static void CorrectSameParameter(TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2)
|
||||
{
|
||||
if (BRep_Tool::Degenerated(theEdge))
|
||||
return;
|
||||
|
||||
Standard_Real fpar, lpar;
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, fpar, lpar);
|
||||
|
||||
Standard_Boolean PCurveExists [2] = {Standard_False, Standard_False};
|
||||
BRepAdaptor_Curve BAcurve [2];
|
||||
|
||||
if (!theFace1.IsNull())
|
||||
{
|
||||
PCurveExists[0] = Standard_True;
|
||||
BAcurve[0].Initialize(theEdge, theFace1);
|
||||
}
|
||||
if (!theFace1.IsNull() &&
|
||||
theFace1.IsSame(theFace2))
|
||||
theEdge.Reverse();
|
||||
if (!theFace2.IsNull())
|
||||
{
|
||||
PCurveExists[1] = Standard_True;
|
||||
BAcurve[1].Initialize(theEdge, theFace2);
|
||||
}
|
||||
|
||||
Standard_Real MaxSqDist = 0.;
|
||||
const Standard_Integer NCONTROL = 23;
|
||||
Standard_Real delta = (lpar - fpar)/NCONTROL;
|
||||
|
||||
for (Standard_Integer i = 0; i <= NCONTROL; i++)
|
||||
{
|
||||
Standard_Real aParam = fpar + i*delta;
|
||||
gp_Pnt aPnt = aCurve->Value(aParam);
|
||||
for (Standard_Integer j = 0; j < 2; j++)
|
||||
if (PCurveExists[j])
|
||||
{
|
||||
gp_Pnt aPntFromFace = BAcurve[j].Value(aParam);
|
||||
Standard_Real aSqDist = aPnt.SquareDistance(aPntFromFace);
|
||||
if (aSqDist > MaxSqDist)
|
||||
MaxSqDist = aSqDist;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real aTol = sqrt(MaxSqDist);
|
||||
BRep_Builder BB;
|
||||
BB.UpdateEdge(theEdge, aTol);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//Objet : Orientate an edge of natural restriction
|
||||
// : General
|
||||
@@ -666,7 +716,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
|
||||
// P2 = BT.Pnt(VL);
|
||||
P2 = BRep_Tool::Pnt(VL);
|
||||
// Tol2 = BT.Tolerance(VF);
|
||||
Tol2 = BRep_Tool::Tolerance(VF);
|
||||
Tol2 = BRep_Tool::Tolerance(VL);
|
||||
Tol = Max(Tol1, Tol2);
|
||||
|
||||
if (VF.IsSame(VL) ||
|
||||
@@ -809,24 +859,44 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
|
||||
Prof1 = BRep_Tool::Curve(E1, f1, l1);
|
||||
// Prof2 = BT.Curve(E2, f2, l2);
|
||||
Prof2 = BRep_Tool::Curve(E2, f2, l2);
|
||||
gp_Pnt P1, P2, P;
|
||||
gp_Pnt2d p1, p2;
|
||||
gp_Trsf Tf;
|
||||
Tf.SetTransformation(Axe);
|
||||
|
||||
// Choose the angle of opening
|
||||
P1 = Prof1->Value((f1+l1)/2);
|
||||
P2 = Prof2->Value((f2+l2)/2);
|
||||
P1.Transform(Tf);
|
||||
P2.Transform(Tf);
|
||||
p1.SetCoord(P1.Z(), P1.X());
|
||||
p2.SetCoord(P2.Z(), P2.X());
|
||||
gp_Vec2d v1(gp::Origin2d(), p1);
|
||||
gp_Vec2d v2(gp::Origin2d(), p2);
|
||||
if (v1.Magnitude() <= gp::Resolution() ||
|
||||
v2.Magnitude() <= gp::Resolution())
|
||||
// Indeed, both Prof1 and Prof2 are the same curves but in different positions
|
||||
|
||||
gp_Pnt P1, P2, P;
|
||||
|
||||
// Choose the angle of opening
|
||||
gp_Trsf aTf;
|
||||
aTf.SetTransformation(Axe);
|
||||
|
||||
// Choose the furthest point from the "center of revolution"
|
||||
// to provide correct angle measurement.
|
||||
const Standard_Real aPrm[] = {f1, 0.5*(f1 + l1), l1};
|
||||
const gp_Pnt aP1[] = {Prof1->Value(aPrm[0]).Transformed(aTf),
|
||||
Prof1->Value(aPrm[1]).Transformed(aTf),
|
||||
Prof1->Value(aPrm[2]).Transformed(aTf)};
|
||||
|
||||
Standard_Integer aMaxIdx = -1;
|
||||
Standard_Real aMaxDist = RealFirst();
|
||||
for (Standard_Integer i = 0; i < 3; i++)
|
||||
{
|
||||
const Standard_Real aDist = aP1[i].X()*aP1[i].X() + aP1[i].Z()*aP1[i].Z();
|
||||
if (aDist > aMaxDist)
|
||||
{
|
||||
aMaxDist = aDist;
|
||||
aMaxIdx = i;
|
||||
}
|
||||
}
|
||||
|
||||
const gp_Pnt aP2 = Prof2->Value(aPrm[aMaxIdx]).Transformed(aTf);
|
||||
const gp_Vec2d aV1(aP1[aMaxIdx].Z(), aP1[aMaxIdx].X());
|
||||
const gp_Vec2d aV2(aP2.Z(), aP2.X());
|
||||
if (aV1.SquareMagnitude() <= gp::Resolution() ||
|
||||
aV2.SquareMagnitude() <= gp::Resolution())
|
||||
{
|
||||
return Standard_False;
|
||||
Angle = v1.Angle(v2);
|
||||
}
|
||||
|
||||
Angle = aV1.Angle(aV2);
|
||||
|
||||
gp_Ax1 axe(Axe.Location(), Axe.YDirection());
|
||||
|
||||
@@ -837,14 +907,14 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
|
||||
|
||||
Handle(Geom_SurfaceOfRevolution) Rev =
|
||||
new (Geom_SurfaceOfRevolution) (Prof1, axe);
|
||||
|
||||
|
||||
Handle(Geom_Surface) Surf =
|
||||
new (Geom_RectangularTrimmedSurface) (Rev, 0, Angle, f1, l1);
|
||||
|
||||
// Control the direction of the rotation
|
||||
Standard_Boolean ToReverseResult = Standard_False;
|
||||
gp_Vec d1u;
|
||||
d1u = Surf->DN(0, (f1+l1)/2, 1, 0);
|
||||
d1u = Surf->DN(0, aPrm[aMaxIdx], 1, 0);
|
||||
if (d1u.Angle(TangentOnPart1) > M_PI/2) { //Invert everything
|
||||
ToReverseResult = Standard_True;
|
||||
/*
|
||||
@@ -1135,19 +1205,40 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
|
||||
B.MakeEdge(Aux2);
|
||||
|
||||
// Set the orientation
|
||||
gp_Vec D1U, D1V, N1, N2;
|
||||
C1->D0( (f1+l1)/2, P2d);
|
||||
Surf->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
|
||||
N1 = D1U^D1V;
|
||||
|
||||
// Provide correct normals computation
|
||||
// (the normal will be computed not in
|
||||
// singularity point definitely).
|
||||
Angle = RealFirst();
|
||||
for (Standard_Integer i = 0; i < 3; i++)
|
||||
{
|
||||
gp_Vec D1U, D1V, N1, N2;
|
||||
C1->D0(aPrm[i], P2d);
|
||||
Surf->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
|
||||
N1 = D1U^D1V;
|
||||
|
||||
if (N1.SquareMagnitude() < Precision::SquareConfusion())
|
||||
continue;
|
||||
|
||||
// C1 = BT.CurveOnSurface(E1, TopoDS::Face(F1), f2, l2);
|
||||
C1 = BRep_Tool::CurveOnSurface(E1, TopoDS::Face(F1), f2, l2);
|
||||
C1->D0(aPrm[i], P2d);
|
||||
Handle(BRepAdaptor_HSurface) AS = new BRepAdaptor_HSurface(TopoDS::Face(F1));
|
||||
AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
|
||||
N2 = D1U^D1V;
|
||||
|
||||
if (N2.SquareMagnitude() < Precision::SquareConfusion())
|
||||
continue;
|
||||
|
||||
Angle = N1.Angle(N2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// C1 = BT.CurveOnSurface(E1, TopoDS::Face(F1), f2, l2);
|
||||
C1 = BRep_Tool::CurveOnSurface(E1, TopoDS::Face(F1), f2, l2);
|
||||
C1->D0( (f1+l1)/2, P2d);
|
||||
Handle(BRepAdaptor_HSurface) AS = new BRepAdaptor_HSurface(TopoDS::Face(F1));
|
||||
AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
|
||||
N2 = D1U^D1V;
|
||||
|
||||
if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>M_PI/2) )
|
||||
if (Angle == RealFirst())
|
||||
return Standard_False;
|
||||
|
||||
if ( (F1.Orientation() == TopAbs_REVERSED) ^ (Angle>M_PI/2))
|
||||
Result.Orientation(TopAbs_REVERSED);
|
||||
else Result.Orientation(TopAbs_FORWARD);
|
||||
|
||||
@@ -1661,6 +1752,60 @@ static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
|
||||
return B;
|
||||
}
|
||||
|
||||
static void ReverseEdgeInFirstOrLastWire(TopoDS_Shape& theWire,
|
||||
const TopoDS_Shape& theEdge)
|
||||
{
|
||||
TopoDS_Shape EdgeToReverse;
|
||||
TopoDS_Iterator itw(theWire);
|
||||
|
||||
for (; itw.More(); itw.Next())
|
||||
{
|
||||
const TopoDS_Shape& anEdge = itw.Value();
|
||||
if (anEdge.IsSame(theEdge))
|
||||
{
|
||||
EdgeToReverse = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!EdgeToReverse.IsNull())
|
||||
{
|
||||
BRep_Builder BB;
|
||||
theWire.Free(Standard_True);
|
||||
BB.Remove(theWire, EdgeToReverse);
|
||||
EdgeToReverse.Reverse();
|
||||
BB.Add(theWire, EdgeToReverse);
|
||||
}
|
||||
}
|
||||
|
||||
static void ReverseModifiedEdges(TopoDS_Wire& theWire,
|
||||
const TopTools_MapOfShape& theEmap)
|
||||
{
|
||||
if (theEmap.IsEmpty())
|
||||
return;
|
||||
|
||||
TopoDS_Iterator itw(theWire);
|
||||
BRep_Builder BB;
|
||||
|
||||
TopTools_ListOfShape Ledges;
|
||||
for (; itw.More(); itw.Next())
|
||||
Ledges.Append(itw.Value());
|
||||
|
||||
theWire.Free(Standard_True);
|
||||
TopTools_ListIteratorOfListOfShape itl(Ledges);
|
||||
for (; itl.More(); itl.Next())
|
||||
BB.Remove(theWire, itl.Value());
|
||||
|
||||
for (itl.Initialize(Ledges); itl.More(); itl.Next())
|
||||
{
|
||||
TopoDS_Shape anEdge = itl.Value();
|
||||
if (theEmap.Contains(anEdge))
|
||||
anEdge.Reverse();
|
||||
BB.Add(theWire, anEdge);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructeur
|
||||
//purpose :
|
||||
@@ -1670,8 +1815,6 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
|
||||
const Standard_Boolean WithKPart) :
|
||||
isDone(Standard_False),
|
||||
KPart(WithKPart)
|
||||
|
||||
|
||||
{
|
||||
mySec = Section;
|
||||
myLoc = Location;
|
||||
@@ -2064,6 +2207,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
|
||||
Standard_Boolean exuv, singu, singv;
|
||||
Handle(Geom_Surface) S;
|
||||
|
||||
//Correct <FirstShape> and <LastShape>: reverse modified edges
|
||||
ReverseModifiedEdges(FirstShape, ReversedEdges);
|
||||
ReverseModifiedEdges(LastShape, ReversedEdges);
|
||||
|
||||
// (2.0) return preexisting Edges and vertices
|
||||
TopoDS_Edge E;
|
||||
TColStd_Array1OfBoolean IsBuilt(1, NbLaw);
|
||||
@@ -2293,7 +2440,6 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
|
||||
|
||||
|
||||
// ---------- Creation of Vertex and edge ------------
|
||||
ReversedEdges.Clear();
|
||||
for (ipath=1, IPath=IFirst; ipath<=NbPath;
|
||||
ipath++, IPath++) {
|
||||
for (isec=1; isec <=NbLaw; isec++) {
|
||||
@@ -2496,7 +2642,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
|
||||
TopoDS::Edge(VEdge(isec, ipath)),
|
||||
ReversedEdges);
|
||||
if (ReversedEdges.Contains(VEdge(isec, ipath)))
|
||||
{
|
||||
ReverseEdgeInFirstOrLastWire(FirstShape, VEdge(isec, ipath));
|
||||
StartEdges(isec).Reverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2536,6 +2685,8 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
|
||||
RebuildTopOrBottomEdge(aNewLastEdge,
|
||||
TopoDS::Edge(VEdge(isec, ipath+1)),
|
||||
ReversedEdges);
|
||||
if (ReversedEdges.Contains(VEdge(isec, ipath+1)))
|
||||
ReverseEdgeInFirstOrLastWire(LastShape, VEdge(isec, ipath+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2877,6 +3028,30 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
|
||||
}
|
||||
}
|
||||
|
||||
//Ensure Same Parameter on U-edges
|
||||
for (ii = myUEdges->LowerRow(); ii <= myUEdges->UpperRow(); ii++)
|
||||
{
|
||||
if (mySec->IsUClosed() && ii == myUEdges->UpperRow())
|
||||
continue;
|
||||
for (jj = myUEdges->LowerCol(); jj <= myUEdges->UpperCol(); jj++)
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(myUEdges->Value(ii, jj));
|
||||
if (anEdge.IsNull())
|
||||
continue;
|
||||
TopoDS_Face Face1, Face2;
|
||||
Standard_Integer i1 = ii-1, i2 = ii;
|
||||
if (i1 == 0 && mySec->IsUClosed())
|
||||
i1 = myFaces->UpperRow();
|
||||
if (i2 > myFaces->UpperRow())
|
||||
i2 = 0;
|
||||
if (i1 != 0)
|
||||
Face1 = TopoDS::Face(myFaces->Value(i1, jj));
|
||||
if (i2 != 0)
|
||||
Face2 = TopoDS::Face(myFaces->Value(i2, jj));
|
||||
CorrectSameParameter(anEdge, Face1, Face2);
|
||||
}
|
||||
}
|
||||
|
||||
for (ii = 1; ii <= NbLaw; ii++)
|
||||
for (jj = 1; jj <= NbPath; jj++)
|
||||
{
|
||||
@@ -3083,7 +3258,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
}
|
||||
}
|
||||
|
||||
BRepFill_TrimShellCorner aTrim(aFaces, AxeOfBisPlane, aPlaneF);
|
||||
BRepFill_TrimShellCorner aTrim(aFaces, Transition, AxeOfBisPlane);
|
||||
aTrim.AddBounds(Bounds);
|
||||
aTrim.AddUEdges(aUEdges);
|
||||
aTrim.Perform();
|
||||
@@ -3172,7 +3347,8 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
|
||||
// Filling
|
||||
B = Filling(It1.Value(), myFaces->Value(ii, I1),
|
||||
It2.Value(), myFaces->Value(ii, I2),
|
||||
myVEdgesModified, myTol3d, Axe, T1, Bord1, Bord2, FF);
|
||||
myVEdgesModified, myTol3d, Axe, T1,
|
||||
Bord1, Bord2, FF);
|
||||
|
||||
if (B) {
|
||||
myAuxShape.Append(FF);
|
||||
|
@@ -80,7 +80,7 @@ public:
|
||||
//! to be C0.
|
||||
Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
|
||||
|
||||
//! Build the Sweeep Surface
|
||||
//! Build the Sweep Surface
|
||||
//! Transition define Transition strategy
|
||||
//! Approx define Approximation Strategy
|
||||
//! - GeomFill_Section : The composed Function Location X Section
|
||||
@@ -118,13 +118,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean CorrectApproxParameters();
|
||||
|
||||
Standard_EXPORT Standard_Boolean BuildWire (const BRepFill_TransitionStyle Transition);
|
||||
@@ -142,6 +135,13 @@ private:
|
||||
Standard_EXPORT void RebuildTopOrBottomEdge (const TopoDS_Edge& aNewEdge, TopoDS_Edge& anEdge, TopTools_MapOfShape& ReversedEdges) const;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_Boolean isDone;
|
||||
Standard_Boolean KPart;
|
||||
Standard_Real myTol3d;
|
||||
@@ -168,7 +168,6 @@ private:
|
||||
TopoDS_Wire FirstShape;
|
||||
TopoDS_Wire LastShape;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <BRepFill_TrimShellCorner.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepLib_MakeWire.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
#include <BRepTools_ReShape.hxx>
|
||||
#include <gce_MakeLin.hxx>
|
||||
#include <GCPnts_UniformAbscissa.hxx>
|
||||
@@ -63,6 +64,23 @@
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <BRepExtrema_ExtCC.hxx>
|
||||
|
||||
static TopoDS_Edge FindEdgeCloseToBisectorPlane(const TopoDS_Vertex& theVertex,
|
||||
TopoDS_Compound& theComp,
|
||||
const gp_Ax1& theAxis);
|
||||
|
||||
static Standard_Boolean FindMiddleEdges(const TopoDS_Vertex& theVertex1,
|
||||
const TopoDS_Vertex& theVertex2,
|
||||
const gp_Ax1& theAxis,
|
||||
TopoDS_Compound& theComp,
|
||||
TopTools_ListOfShape& theElist);
|
||||
|
||||
static Standard_Boolean FindCommonVertex(const TopoDS_Edge& theFirstEdge,
|
||||
const TopoDS_Edge& theLastEdge,
|
||||
const TopoDS_Vertex& theFirstVertex,
|
||||
const TopoDS_Vertex& theLastVertex,
|
||||
TopoDS_Vertex& theCommonVertex);
|
||||
|
||||
static Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theEIndex1,
|
||||
@@ -71,24 +89,6 @@ static Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
|
||||
Standard_Real& theParamOnE1,
|
||||
Standard_Real& theParamOnE2);
|
||||
|
||||
static Standard_Boolean MakeFacesNonSec(const Standard_Integer theIndex,
|
||||
const Handle(TopTools_HArray2OfShape)& theUEdges,
|
||||
const Handle(TopTools_HArray2OfShape)& theBounds,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
TopTools_DataMapOfShapeListOfShape& theHistMap);
|
||||
|
||||
static Standard_Boolean MakeFacesSec(const Standard_Integer theIndex,
|
||||
const Handle(TopTools_HArray2OfShape)& theUEdges,
|
||||
const Handle(TopTools_HArray2OfShape)& theBounds,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
const Standard_Integer theSSInterfIndex,
|
||||
const gp_Ax2& AxeOfBisPlane,
|
||||
TopTools_DataMapOfShapeListOfShape& theHistMap);
|
||||
|
||||
static Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges,
|
||||
const BOPDS_PDS& theDS,
|
||||
TopTools_DataMapOfShapeListOfShape& theHistMap);
|
||||
@@ -186,55 +186,27 @@ static Standard_Real ComputeAveragePlaneAndMaxDeviation(const TopoDS_Shape& aWir
|
||||
gp_Pln& thePlane,
|
||||
Standard_Boolean& IsSingular);
|
||||
|
||||
static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
|
||||
const gp_Ax2& bis,
|
||||
TopoDS_Shape& resWire,
|
||||
gp_Pln& resPlane,
|
||||
Standard_Boolean& IsSingular);
|
||||
static void UpdateSectionEdge(TopoDS_Edge& theEdge,
|
||||
const TopoDS_Vertex& theConstVertex,
|
||||
TopoDS_Vertex& theVertex,
|
||||
const Standard_Real theParam);
|
||||
|
||||
|
||||
// ===========================================================================================
|
||||
// function: Constructor
|
||||
// purpose:
|
||||
// ===========================================================================================
|
||||
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
|
||||
const gp_Ax2& theAxeOfBisPlane,
|
||||
const TopoDS_Face& theSecPlane) :
|
||||
myAxeOfBisPlane(theAxeOfBisPlane),
|
||||
myDone(Standard_False),
|
||||
myHasSection(Standard_False)
|
||||
const BRepFill_TransitionStyle theTransition,
|
||||
const gp_Ax2& theAxeOfBisPlane) :
|
||||
myTransition(theTransition),
|
||||
myAxeOfBisPlane(theAxeOfBisPlane),
|
||||
myDone(Standard_False),
|
||||
myHasSection(Standard_False)
|
||||
{
|
||||
myFaces = new TopTools_HArray2OfShape(theFaces->LowerRow(), theFaces->UpperRow(),
|
||||
theFaces->LowerCol(), theFaces->UpperCol());
|
||||
myFaces->ChangeArray2() = theFaces->Array2();
|
||||
mySecPln = theSecPlane;
|
||||
}
|
||||
|
||||
// ===========================================================================================
|
||||
// function: Constructor
|
||||
// purpose:
|
||||
// ===========================================================================================
|
||||
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
|
||||
const gp_Ax2& theAxeOfBisPlane,
|
||||
const TopoDS_Wire& theSpine,
|
||||
const TopoDS_Face& theSecPlane):
|
||||
myAxeOfBisPlane(theAxeOfBisPlane),
|
||||
myDone(Standard_False),
|
||||
myHasSection(Standard_False)
|
||||
{
|
||||
myFaces = new TopTools_HArray2OfShape(theFaces->LowerRow(), theFaces->UpperRow(),
|
||||
theFaces->LowerCol(), theFaces->UpperCol());
|
||||
myFaces->ChangeArray2() = theFaces->Array2();
|
||||
mySpine = theSpine;
|
||||
mySecPln = theSecPlane;
|
||||
}
|
||||
|
||||
// ===========================================================================================
|
||||
// function: SetSpine
|
||||
// purpose:
|
||||
// ===========================================================================================
|
||||
void BRepFill_TrimShellCorner::SetSpine(const TopoDS_Wire& theSpine)
|
||||
{
|
||||
mySpine = theSpine;
|
||||
}
|
||||
|
||||
// ===========================================================================================
|
||||
@@ -351,14 +323,13 @@ void BRepFill_TrimShellCorner::Perform()
|
||||
}
|
||||
|
||||
if(!bhassec) {
|
||||
if(!MakeFacesNonSec(ii, myUEdges, myBounds, theDS, anIndex1, anIndex2, myHistMap)) {
|
||||
if(!MakeFacesNonSec(ii, theDS, anIndex1, anIndex2)) {
|
||||
myHistMap.Clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!MakeFacesSec(ii, myUEdges, myBounds, theDS, anIndex1, anIndex2,
|
||||
i, myAxeOfBisPlane, myHistMap)) {
|
||||
if(!MakeFacesSec(ii, theDS, anIndex1, anIndex2, i)) {
|
||||
myHistMap.Clear();
|
||||
return;
|
||||
}
|
||||
@@ -403,23 +374,21 @@ void BRepFill_TrimShellCorner::Modified(const TopoDS_Shape& theShape,
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// static function: MakeFacesNonSec
|
||||
// purpose:
|
||||
// function: MakeFacesNonSec
|
||||
// purpose: Updates <myHistMap> by new faces in the case when old faces do not intersect
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
Standard_Boolean MakeFacesNonSec(const Standard_Integer theIndex,
|
||||
const Handle(TopTools_HArray2OfShape)& theUEdges,
|
||||
const Handle(TopTools_HArray2OfShape)& theBounds,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
TopTools_DataMapOfShapeListOfShape& theHistMap)
|
||||
Standard_Boolean
|
||||
BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer theIndex,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2)
|
||||
{
|
||||
Standard_Boolean bHasNewEdge = Standard_False;
|
||||
TopoDS_Edge aNewEdge;
|
||||
|
||||
BRep_Builder aBB;
|
||||
const TopoDS_Shape& aE1 = theBounds->Value(theIndex, 1);
|
||||
const TopoDS_Shape& aE2 = theBounds->Value(theIndex, 2);
|
||||
const TopoDS_Shape& aE1 = myBounds->Value(theIndex, 1);
|
||||
const TopoDS_Shape& aE2 = myBounds->Value(theIndex, 2);
|
||||
|
||||
// search common vertex between bounds. begin
|
||||
TopoDS_Vertex aCommonVertex;
|
||||
@@ -439,20 +408,20 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
Standard_Integer ueit = 0, eindex = 0;
|
||||
|
||||
for(ueit = 1, eindex = theIndex; ueit <= 2; ueit++, eindex++) {
|
||||
const TopoDS_Shape& aShape1 = theUEdges->Value(eindex, theUEdges->LowerCol());
|
||||
const TopoDS_Shape& aShape2 = theUEdges->Value(eindex, theUEdges->UpperCol());
|
||||
const TopoDS_Shape& aShape1 = myUEdges->Value(eindex, myUEdges->LowerCol());
|
||||
const TopoDS_Shape& aShape2 = myUEdges->Value(eindex, myUEdges->UpperCol());
|
||||
TopoDS_Edge aUE1 = TopoDS::Edge(aShape1);
|
||||
TopoDS_Edge aUE2 = TopoDS::Edge(aShape2);
|
||||
|
||||
if(theHistMap.IsBound(aShape1)) {
|
||||
const TopTools_ListOfShape& lst = theHistMap.Find(aShape1);
|
||||
if (myHistMap.IsBound(aShape1)) {
|
||||
const TopTools_ListOfShape& lst = myHistMap.Find(aShape1);
|
||||
|
||||
if(!lst.IsEmpty())
|
||||
aUE1 = TopoDS::Edge(lst.First());
|
||||
}
|
||||
|
||||
if(theHistMap.IsBound(aShape2)) {
|
||||
const TopTools_ListOfShape& lst = theHistMap.Find(aShape2);
|
||||
if (myHistMap.IsBound(aShape2)) {
|
||||
const TopTools_ListOfShape& lst = myHistMap.Find(aShape2);
|
||||
|
||||
if(!lst.IsEmpty())
|
||||
aUE2 = TopoDS::Edge(lst.First());
|
||||
@@ -499,11 +468,11 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
aBB.MakeCompound(aComp);
|
||||
|
||||
for(ueit = 1, eindex = theIndex; ueit <= 2; ueit++, eindex++) {
|
||||
const TopoDS_Shape& aShape = theUEdges->Value(eindex, theUEdges->LowerCol() + fit - 1);
|
||||
const TopoDS_Shape& aShape = myUEdges->Value(eindex, myUEdges->LowerCol() + fit - 1);
|
||||
TopoDS_Shape aUE = aShape;
|
||||
|
||||
if(theHistMap.IsBound(aShape)) {
|
||||
const TopTools_ListOfShape& lst = theHistMap.Find(aShape);
|
||||
if(myHistMap.IsBound(aShape)) {
|
||||
const TopTools_ListOfShape& lst = myHistMap.Find(aShape);
|
||||
|
||||
if(!lst.IsEmpty())
|
||||
aUE = TopoDS::Edge(lst.First());
|
||||
@@ -638,7 +607,7 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
aNewFace.Orientation(aFaceOri);
|
||||
TopTools_ListOfShape atmpList;
|
||||
atmpList.Append(aNewFace);
|
||||
theHistMap.Bind(aFace, atmpList);
|
||||
myHistMap.Bind(aFace, atmpList);
|
||||
|
||||
anExpE.Init(aFace, TopAbs_EDGE);
|
||||
|
||||
@@ -648,7 +617,7 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
if(aNewValue.IsNull() || aNewValue.IsSame(anExpE.Current()))
|
||||
continue;
|
||||
|
||||
if(theHistMap.IsBound(anExpE.Current()))
|
||||
if (myHistMap.IsBound(anExpE.Current()))
|
||||
continue;
|
||||
TopTools_ListOfShape aListOfNewEdge;
|
||||
TopExp_Explorer anExpE2(aNewValue, TopAbs_EDGE);
|
||||
@@ -656,7 +625,7 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
for(; anExpE2.More(); anExpE2.Next()) {
|
||||
aListOfNewEdge.Append(anExpE2.Current());
|
||||
}
|
||||
theHistMap.Bind(anExpE.Current(), aListOfNewEdge);
|
||||
myHistMap.Bind(anExpE.Current(), aListOfNewEdge);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,18 +633,15 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// static function: MakeFacesSec
|
||||
// purpose:
|
||||
// function: MakeFacesSec
|
||||
// purpose: Updates <myHistMap> by new faces in the case when old faces intersect each other
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
Standard_Boolean MakeFacesSec(const Standard_Integer theIndex,
|
||||
const Handle(TopTools_HArray2OfShape)& theUEdges,
|
||||
const Handle(TopTools_HArray2OfShape)& theBounds,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
const Standard_Integer theSSInterfIndex,
|
||||
const gp_Ax2& AxeOfBisPlane,
|
||||
TopTools_DataMapOfShapeListOfShape& theHistMap)
|
||||
Standard_Boolean
|
||||
BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer theIndex,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
const Standard_Integer theSSInterfIndex)
|
||||
{
|
||||
const BOPDS_VectorOfInterfFF& aFFs = theDS->InterfFF();
|
||||
const BOPDS_InterfFF& aFFi = aFFs(theSSInterfIndex);
|
||||
@@ -687,10 +653,30 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
if(!FilterSectionEdges(aBCurves, aSecPlane, theDS, aSecEdges))
|
||||
return Standard_False;
|
||||
|
||||
//Extract vertices on the intersection of correspondent U-edges
|
||||
const TopoDS_Shape& LeftE1 = myUEdges->Value(theIndex, 1);
|
||||
const TopoDS_Shape& LeftE2 = myUEdges->Value(theIndex, 2);
|
||||
const TopoDS_Shape& RightE1 = myUEdges->Value(theIndex+1, 1);
|
||||
const TopoDS_Shape& RightE2 = myUEdges->Value(theIndex+1, 2);
|
||||
|
||||
Standard_Integer IndexOfLeftE1 = theDS->Index(LeftE1);
|
||||
Standard_Integer IndexOfLeftE2 = theDS->Index(LeftE2);
|
||||
Standard_Integer IndexOfRightE1 = theDS->Index(RightE1);
|
||||
Standard_Integer IndexOfRightE2 = theDS->Index(RightE2);
|
||||
|
||||
TopoDS_Vertex FirstVertex, LastVertex;
|
||||
Standard_Real ParamOnLeftE1, ParamOnLeftE2, ParamOnRightE1, ParamOnRightE2;
|
||||
FindCommonVertex(theDS, IndexOfLeftE1, IndexOfLeftE2,
|
||||
FirstVertex, ParamOnLeftE1, ParamOnLeftE2);
|
||||
FindCommonVertex(theDS, IndexOfRightE1, IndexOfRightE2,
|
||||
LastVertex, ParamOnRightE1, ParamOnRightE2);
|
||||
|
||||
TopoDS_Shape SecWire;
|
||||
gp_Pln SecPlane;
|
||||
Standard_Boolean IsSingular;
|
||||
Standard_Boolean WireFound = ChooseSection( aSecEdges, AxeOfBisPlane, SecWire, SecPlane, IsSingular );
|
||||
Standard_Boolean WireFound = ChooseSection(aSecEdges,
|
||||
FirstVertex, LastVertex,
|
||||
SecWire, SecPlane, IsSingular );
|
||||
|
||||
if(WireFound) {
|
||||
//aSecEdges = SecWire;
|
||||
@@ -715,19 +701,19 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
TopAbs_Orientation aFaceOri = aFace.Orientation();
|
||||
TopoDS_Face aFaceF = aFace;
|
||||
aFaceF.Orientation(TopAbs_FORWARD);
|
||||
TopoDS_Edge aBoundEdge = TopoDS::Edge(theBounds->Value(theIndex, theBounds->LowerCol() +fit));
|
||||
TopoDS_Edge aBoundEdge = TopoDS::Edge(myBounds->Value(theIndex, myBounds->LowerCol() +fit));
|
||||
Standard_Integer aBoundEdgeIndex = theDS->Index(aBoundEdge);
|
||||
TopoDS_Edge aUE1;
|
||||
TopoDS_Edge aUE2;
|
||||
|
||||
if(!GetUEdges(theIndex, fit, theUEdges, aBoundEdge, aFaceF, aUE1, aUE2))
|
||||
if(!GetUEdges(theIndex, fit, myUEdges, aBoundEdge, aFaceF, aUE1, aUE2))
|
||||
return Standard_False;
|
||||
|
||||
TopoDS_Edge aUE1old = aUE1;
|
||||
TopoDS_Edge aUE2old = aUE2;
|
||||
|
||||
if(theHistMap.IsBound(aUE1)) {
|
||||
const TopTools_ListOfShape& lst = theHistMap.Find(aUE1);
|
||||
if (myHistMap.IsBound(aUE1)) {
|
||||
const TopTools_ListOfShape& lst = myHistMap.Find(aUE1);
|
||||
|
||||
if(!lst.IsEmpty()) {
|
||||
const TopoDS_Shape& anEdge = lst.First().Oriented(aUE1.Orientation());
|
||||
@@ -738,8 +724,8 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
}
|
||||
}
|
||||
|
||||
if(theHistMap.IsBound(aUE2)) {
|
||||
const TopTools_ListOfShape& lst = theHistMap.Find(aUE2);
|
||||
if (myHistMap.IsBound(aUE2)) {
|
||||
const TopTools_ListOfShape& lst = myHistMap.Find(aUE2);
|
||||
|
||||
if(!lst.IsEmpty()) {
|
||||
const TopoDS_Shape& anEdge = lst.First().Oriented(aUE2.Orientation());
|
||||
@@ -757,12 +743,12 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
Standard_Boolean isPave1OnUEdge = Standard_True;
|
||||
|
||||
if(FindFromUEdge(aUE1old, aUE2old, aUE1, aUE2, aFace, aSecEdges, fit, aBoundEdge, aBoundEdgeIndex,
|
||||
theDS, theHistMap, aCompOfSecEdges, aListOfWireEdges, aPave1, isPave1OnUEdge)) {
|
||||
theDS, myHistMap, aCompOfSecEdges, aListOfWireEdges, aPave1, isPave1OnUEdge)) {
|
||||
TopTools_ListOfShape aSecondListOfEdges;
|
||||
Standard_Boolean bisSectionFound = Standard_False;
|
||||
|
||||
if(!FindFromVEdge(aPave1, isPave1OnUEdge, aUE1old, aUE2old, aFace, aCompOfSecEdges, fit, aBoundEdge,
|
||||
aBoundEdgeIndex, theDS, theHistMap, aSecondListOfEdges, bisSectionFound)) {
|
||||
aBoundEdgeIndex, theDS, myHistMap, aSecondListOfEdges, bisSectionFound)) {
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
@@ -792,7 +778,7 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
aNewFace.Orientation(aFaceOri);
|
||||
TopTools_ListOfShape atmpList;
|
||||
atmpList.Append(aNewFace);
|
||||
theHistMap.Bind(aFace, atmpList);
|
||||
myHistMap.Bind(aFace, atmpList);
|
||||
|
||||
TopExp_Explorer anExpE(aFace, TopAbs_EDGE);
|
||||
|
||||
@@ -802,7 +788,7 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
if(aNewValue.IsNull() || aNewValue.IsSame(anExpE.Current()))
|
||||
continue;
|
||||
|
||||
if(theHistMap.IsBound(anExpE.Current()))
|
||||
if (myHistMap.IsBound(anExpE.Current()))
|
||||
continue;
|
||||
TopTools_ListOfShape aListOfNewEdge;
|
||||
TopExp_Explorer anExpE2(aNewValue, TopAbs_EDGE);
|
||||
@@ -810,12 +796,240 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
|
||||
for(; anExpE2.More(); anExpE2.Next()) {
|
||||
aListOfNewEdge.Append(anExpE2.Current());
|
||||
}
|
||||
theHistMap.Bind(anExpE.Current(), aListOfNewEdge);
|
||||
myHistMap.Bind(anExpE.Current(), aListOfNewEdge);
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChooseSection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Comp,
|
||||
const TopoDS_Vertex& theFirstVertex,
|
||||
const TopoDS_Vertex& theLastVertex,
|
||||
TopoDS_Shape& resWire,
|
||||
gp_Pln& resPlane,
|
||||
Standard_Boolean& IsSingular)
|
||||
{
|
||||
IsSingular = Standard_False;
|
||||
|
||||
Standard_Integer ind, i, j;
|
||||
BRep_Builder BB;
|
||||
|
||||
if (myTransition == BRepFill_Right &&
|
||||
!theFirstVertex.IsNull() &&
|
||||
!theLastVertex.IsNull()) //the case where section wire goes from
|
||||
//its known first vertex to its known last vertex
|
||||
{
|
||||
TopoDS_Wire NewWire;
|
||||
BB.MakeWire(NewWire);
|
||||
|
||||
TopoDS_Compound OldComp;
|
||||
BB.MakeCompound( OldComp );
|
||||
TopoDS_Iterator iter( Comp );
|
||||
for (; iter.More(); iter.Next())
|
||||
BB.Add( OldComp, iter.Value() );
|
||||
|
||||
TopoDS_Edge FirstEdge = FindEdgeCloseToBisectorPlane(theFirstVertex,
|
||||
OldComp,
|
||||
myAxeOfBisPlane.Axis());
|
||||
iter.Initialize(OldComp);
|
||||
if (!iter.More())
|
||||
{
|
||||
iter.Initialize(Comp);
|
||||
BB.Add( OldComp, iter.Value() );
|
||||
}
|
||||
TopoDS_Edge LastEdge = FindEdgeCloseToBisectorPlane(theLastVertex,
|
||||
OldComp,
|
||||
myAxeOfBisPlane.Axis());
|
||||
|
||||
BB.Add(NewWire, FirstEdge);
|
||||
|
||||
if (!FirstEdge.IsSame(LastEdge))
|
||||
{
|
||||
TopoDS_Vertex aCommonVertex;
|
||||
Standard_Boolean CommonVertexExists = FindCommonVertex(FirstEdge, LastEdge,
|
||||
theFirstVertex, theLastVertex,
|
||||
aCommonVertex);
|
||||
if (CommonVertexExists)
|
||||
BB.Add(NewWire, LastEdge);
|
||||
else
|
||||
{
|
||||
TopoDS_Vertex Vertex1, Vertex2, V1, V2;
|
||||
TopExp::Vertices(FirstEdge, V1, V2);
|
||||
Vertex1 = (theFirstVertex.IsSame(V1))? V2 : V1;
|
||||
TopExp::Vertices(LastEdge, V1, V2);
|
||||
Vertex2 = (theLastVertex.IsSame(V1))? V2 : V1;
|
||||
|
||||
TopTools_ListOfShape MiddleEdges;
|
||||
if (FindMiddleEdges(Vertex1, Vertex2, myAxeOfBisPlane.Axis(), OldComp, MiddleEdges))
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape itl(MiddleEdges);
|
||||
for (; itl.More(); itl.Next())
|
||||
BB.Add(NewWire, itl.Value());
|
||||
BB.Add(NewWire, LastEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
//trim <FirstEdge> and <LastEdge> in the points of extrema
|
||||
//these points become new vertex with centre between them
|
||||
BRepExtrema_ExtCC Extrema(FirstEdge, LastEdge);
|
||||
if (Extrema.IsDone() && Extrema.NbExt() > 0)
|
||||
{
|
||||
Standard_Integer imin = 1;
|
||||
for (i = 2; i <= Extrema.NbExt(); i++)
|
||||
if (Extrema.SquareDistance(i) < Extrema.SquareDistance(imin))
|
||||
imin = i;
|
||||
|
||||
Standard_Real aMinDist = sqrt(Extrema.SquareDistance(imin));
|
||||
Standard_Real ParamOnFirstEdge = Extrema.ParameterOnE1(imin);
|
||||
Standard_Real ParamOnLastEdge = Extrema.ParameterOnE2(imin);
|
||||
gp_Pnt PointOnFirstEdge = Extrema.PointOnE1(imin);
|
||||
gp_Pnt PointOnLastEdge = Extrema.PointOnE2(imin);
|
||||
gp_Pnt MidPnt((PointOnFirstEdge.XYZ() + PointOnLastEdge.XYZ())/2);
|
||||
aCommonVertex = BRepLib_MakeVertex(MidPnt);
|
||||
BB.UpdateVertex(aCommonVertex, 1.001*aMinDist/2);
|
||||
|
||||
UpdateSectionEdge(FirstEdge, theFirstVertex, aCommonVertex, ParamOnFirstEdge);
|
||||
UpdateSectionEdge(LastEdge, theLastVertex, aCommonVertex, ParamOnLastEdge);
|
||||
|
||||
BB.Add(NewWire, LastEdge);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resWire = NewWire;
|
||||
resPlane = gp_Pln(myAxeOfBisPlane);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//General case: try to find continuous section closest to bisector plane
|
||||
TopoDS_Compound OldComp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound( OldComp );
|
||||
TopoDS_Iterator iter( Comp );
|
||||
for (; iter.More(); iter.Next())
|
||||
B.Add( OldComp, iter.Value() );
|
||||
|
||||
Standard_Boolean anError = Standard_False;
|
||||
//TopoDS_Wire NewWire [2];
|
||||
TopTools_SequenceOfShape Wseq;
|
||||
for (;;)
|
||||
{
|
||||
TopExp_Explorer explo( OldComp, TopAbs_EDGE );
|
||||
if (!explo.More())
|
||||
break;
|
||||
TopoDS_Edge FirstEdge = TopoDS::Edge( explo.Current() );
|
||||
TopoDS_Wire NewWire = BRepLib_MakeWire( FirstEdge );
|
||||
B.Remove( OldComp, FirstEdge );
|
||||
if (NewWire.Closed())
|
||||
{
|
||||
Wseq.Append(NewWire);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
TopoDS_Vertex Extremity [2];
|
||||
TopExp::Vertices( NewWire, Extremity[0], Extremity[1] );
|
||||
if (Extremity[0].IsNull() || Extremity[1].IsNull())
|
||||
{
|
||||
anError = Standard_True;
|
||||
break;
|
||||
}
|
||||
TopTools_IndexedDataMapOfShapeListOfShape VEmap;
|
||||
TopExp::MapShapesAndAncestors( OldComp, TopAbs_VERTEX, TopAbs_EDGE, VEmap );
|
||||
TopTools_ListOfShape Vedges [2];
|
||||
for (j = 0; j < 2; j++)
|
||||
if (VEmap.Contains( Extremity[j] ))
|
||||
Vedges[j] = VEmap.FindFromKey( Extremity[j] );
|
||||
if (Vedges[0].IsEmpty() && Vedges[1].IsEmpty())
|
||||
//no more edges in OldComp to continue NewWire
|
||||
break;
|
||||
Standard_Boolean Modified = Standard_False;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (Vedges[j].Extent() == 1)
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge( Vedges[j].First() );
|
||||
NewWire = BRepLib_MakeWire( NewWire, anEdge );
|
||||
B.Remove( OldComp, anEdge );
|
||||
Modified = Standard_True;
|
||||
}
|
||||
}
|
||||
if (!Modified) //only multiple connections
|
||||
{
|
||||
ind = (Vedges[0].IsEmpty())? 1 : 0;
|
||||
TopTools_SequenceOfShape Edges;
|
||||
TopTools_ListIteratorOfListOfShape itl( Vedges[ind] );
|
||||
for (; itl.More(); itl.Next())
|
||||
Edges.Append( itl.Value() );
|
||||
Standard_Integer theind=0;
|
||||
Standard_Real MinDeviation = RealLast();
|
||||
for (j = 1; j <= Edges.Length(); j++)
|
||||
{
|
||||
TopoDS_Wire aWire = BRepLib_MakeWire( NewWire, TopoDS::Edge(Edges(j)) );
|
||||
gp_Pln aPlane;
|
||||
Standard_Boolean issing;
|
||||
Standard_Real Deviation = ComputeAveragePlaneAndMaxDeviation( aWire, aPlane, issing );
|
||||
if (Deviation < MinDeviation)
|
||||
{
|
||||
MinDeviation = Deviation;
|
||||
theind = j;
|
||||
}
|
||||
}
|
||||
NewWire = BRepLib_MakeWire( NewWire, TopoDS::Edge(Edges(theind)) );
|
||||
B.Remove( OldComp, Edges(theind) );
|
||||
}
|
||||
if (NewWire.Closed())
|
||||
break;
|
||||
}
|
||||
Wseq.Append(NewWire);
|
||||
if (anError)
|
||||
break;
|
||||
}
|
||||
|
||||
Standard_Real MinAngle = RealLast();
|
||||
TopExp_Explorer Explo( OldComp, TopAbs_EDGE );
|
||||
if (!anError && !Explo.More()) //wires are built successfully and compound <OldComp> is empty
|
||||
{
|
||||
if (Wseq.Length() == 1) //only one wire => it becomes result
|
||||
{
|
||||
resWire = Wseq.First();
|
||||
ComputeAveragePlaneAndMaxDeviation( resWire, resPlane, IsSingular );
|
||||
return Standard_True;
|
||||
}
|
||||
else //we must choose the wire which average plane is closest to bisector plane
|
||||
{ //(check angle between axes)
|
||||
for (i = 1; i <= Wseq.Length(); i++)
|
||||
{
|
||||
TopoDS_Wire aWire = TopoDS::Wire( Wseq(i) );
|
||||
gp_Pln aPln;
|
||||
Standard_Boolean issing;
|
||||
ComputeAveragePlaneAndMaxDeviation( aWire, aPln, issing );
|
||||
if (issing)
|
||||
continue;
|
||||
|
||||
Standard_Real Angle = aPln.Axis().Angle( myAxeOfBisPlane.Axis() );
|
||||
if (Angle > M_PI/2)
|
||||
Angle = M_PI - Angle;
|
||||
|
||||
if (Angle < MinAngle)
|
||||
{
|
||||
MinAngle = Angle;
|
||||
resWire = aWire;
|
||||
resPlane = aPln;
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// static function: SplitUEdges
|
||||
@@ -966,13 +1180,15 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
|
||||
continue;
|
||||
|
||||
IntTools_CommonPrt aCP = aEE.CommonPart();
|
||||
if(aCP.Type() == TopAbs_VERTEX) {
|
||||
if(aCP.Type() == TopAbs_VERTEX)
|
||||
{
|
||||
theCommonVertex = *(TopoDS_Vertex*)&theDS->Shape(aEE.IndexNew());
|
||||
if (theEIndex1 == aEE.Index1()) {
|
||||
|
||||
if (theEIndex1 == aEE.Index1())
|
||||
IntTools_Tools::VertexParameters(aCP, theParamOnE1, theParamOnE2);
|
||||
} else {
|
||||
else
|
||||
IntTools_Tools::VertexParameters(aCP, theParamOnE2, theParamOnE1);
|
||||
}
|
||||
|
||||
//
|
||||
bvertexfound = Standard_True;
|
||||
break;
|
||||
@@ -2004,147 +2220,182 @@ static Standard_Real ComputeAveragePlaneAndMaxDeviation(const TopoDS_Shape& aWir
|
||||
return MaxDeviation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChooseSection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
|
||||
const gp_Ax2& bis,
|
||||
TopoDS_Shape& resWire,
|
||||
gp_Pln& resPlane,
|
||||
Standard_Boolean& IsSingular)
|
||||
|
||||
static void UpdateSectionEdge(TopoDS_Edge& theEdge,
|
||||
const TopoDS_Vertex& theConstVertex,
|
||||
TopoDS_Vertex& theVertex,
|
||||
const Standard_Real theParam)
|
||||
{
|
||||
IsSingular = Standard_False;
|
||||
Standard_Real TolDeviation = 0.01; //, TolConf = 1.e-4, TolAng = 1.e-5;
|
||||
TopoDS_Edge F_Edge = theEdge;
|
||||
F_Edge.Orientation(TopAbs_FORWARD);
|
||||
|
||||
TopAbs_Orientation OrOfVertex;
|
||||
TopoDS_Vertex V1, V2, AnotherVertex;
|
||||
TopExp::Vertices(F_Edge, V1, V2);
|
||||
if (theConstVertex.IsSame(V1))
|
||||
{
|
||||
//OrOfConst = TopAbs_FORWARD;
|
||||
OrOfVertex = TopAbs_REVERSED;
|
||||
AnotherVertex = V2;
|
||||
}
|
||||
else
|
||||
{
|
||||
//OrOfConst = TopAbs_REVERSED;
|
||||
OrOfVertex = TopAbs_FORWARD;
|
||||
AnotherVertex = V1;
|
||||
}
|
||||
|
||||
// Standard_Integer N = 100;
|
||||
Standard_Integer ind, i, j;
|
||||
BRep_Builder BB;
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Tool::Range(F_Edge, fpar, lpar);
|
||||
if (OrOfVertex == TopAbs_FORWARD)
|
||||
fpar = theParam;
|
||||
else
|
||||
lpar = theParam;
|
||||
BB.Range(F_Edge, fpar, lpar);
|
||||
|
||||
//Simplest case
|
||||
TopoDS_Compound OldComp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound( OldComp );
|
||||
TopoDS_Iterator iter( Comp );
|
||||
for (; iter.More(); iter.Next())
|
||||
B.Add( OldComp, iter.Value() );
|
||||
|
||||
Standard_Boolean anError = Standard_False;
|
||||
//TopoDS_Wire NewWire [2];
|
||||
TopTools_SequenceOfShape Wseq;
|
||||
for (;;)
|
||||
{
|
||||
TopExp_Explorer explo( OldComp, TopAbs_EDGE );
|
||||
if (!explo.More())
|
||||
break;
|
||||
TopoDS_Edge FirstEdge = TopoDS::Edge( explo.Current() );
|
||||
TopoDS_Wire NewWire = BRepLib_MakeWire( FirstEdge );
|
||||
B.Remove( OldComp, FirstEdge );
|
||||
if (NewWire.Closed())
|
||||
{
|
||||
Wseq.Append(NewWire);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
TopoDS_Vertex Extremity [2];
|
||||
TopExp::Vertices( NewWire, Extremity[0], Extremity[1] );
|
||||
if (Extremity[0].IsNull() || Extremity[1].IsNull())
|
||||
{
|
||||
anError = Standard_True;
|
||||
break;
|
||||
}
|
||||
TopTools_IndexedDataMapOfShapeListOfShape VEmap;
|
||||
TopExp::MapShapesAndAncestors( OldComp, TopAbs_VERTEX, TopAbs_EDGE, VEmap );
|
||||
TopTools_ListOfShape Vedges [2];
|
||||
for (j = 0; j < 2; j++)
|
||||
if (VEmap.Contains( Extremity[j] ))
|
||||
Vedges[j] = VEmap.FindFromKey( Extremity[j] );
|
||||
if (Vedges[0].IsEmpty() && Vedges[1].IsEmpty())
|
||||
//no more edges in OldComp to continue NewWire
|
||||
break;
|
||||
Standard_Boolean Modified = Standard_False;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (Vedges[j].Extent() == 1)
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge( Vedges[j].First() );
|
||||
NewWire = BRepLib_MakeWire( NewWire, anEdge );
|
||||
B.Remove( OldComp, anEdge );
|
||||
Modified = Standard_True;
|
||||
}
|
||||
}
|
||||
if (!Modified) //only multiple connections
|
||||
{
|
||||
ind = (Vedges[0].IsEmpty())? 1 : 0;
|
||||
TopTools_SequenceOfShape Edges;
|
||||
TopTools_ListIteratorOfListOfShape itl( Vedges[ind] );
|
||||
for (; itl.More(); itl.Next())
|
||||
Edges.Append( itl.Value() );
|
||||
Standard_Integer theind=0;
|
||||
Standard_Real MinDeviation = RealLast();
|
||||
for (j = 1; j <= Edges.Length(); j++)
|
||||
{
|
||||
TopoDS_Wire aWire = BRepLib_MakeWire( NewWire, TopoDS::Edge(Edges(j)) );
|
||||
gp_Pln aPlane;
|
||||
Standard_Boolean issing;
|
||||
Standard_Real Deviation = ComputeAveragePlaneAndMaxDeviation( aWire, aPlane, issing );
|
||||
if (Deviation < MinDeviation)
|
||||
{
|
||||
MinDeviation = Deviation;
|
||||
theind = j;
|
||||
}
|
||||
}
|
||||
NewWire = BRepLib_MakeWire( NewWire, TopoDS::Edge(Edges(theind)) );
|
||||
B.Remove( OldComp, Edges(theind) );
|
||||
}
|
||||
if (NewWire.Closed())
|
||||
break;
|
||||
}
|
||||
Wseq.Append(NewWire);
|
||||
if (anError)
|
||||
break;
|
||||
}
|
||||
|
||||
Standard_Real Deviation=0.;
|
||||
Standard_Real MinAngle = RealLast();
|
||||
TopExp_Explorer Explo( OldComp, TopAbs_EDGE );
|
||||
if (!anError && !Explo.More())
|
||||
{
|
||||
if (Wseq.Length() == 1)
|
||||
{
|
||||
resWire = Wseq.First();
|
||||
Deviation = ComputeAveragePlaneAndMaxDeviation( resWire, resPlane, IsSingular );
|
||||
return Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 1; i <= Wseq.Length(); i++)
|
||||
{
|
||||
TopoDS_Wire aWire = TopoDS::Wire( Wseq(i) );
|
||||
gp_Pln aPln;
|
||||
Standard_Boolean issing;
|
||||
Standard_Real aDeviation =
|
||||
ComputeAveragePlaneAndMaxDeviation( aWire, aPln, issing );
|
||||
if (issing)
|
||||
continue;
|
||||
|
||||
Standard_Real Angle = aPln.Axis().Angle( bis.Axis() );
|
||||
if (Angle > M_PI/2)
|
||||
Angle = M_PI - Angle;
|
||||
|
||||
if (Angle < MinAngle)
|
||||
{
|
||||
MinAngle = Angle;
|
||||
resWire = aWire;
|
||||
resPlane = aPln;
|
||||
Deviation = aDeviation;
|
||||
}
|
||||
}
|
||||
if (Deviation <= TolDeviation)
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
//end of simplest case
|
||||
F_Edge.Free(Standard_True);
|
||||
BB.Remove(F_Edge, AnotherVertex);
|
||||
theVertex.Orientation(OrOfVertex);
|
||||
BB.Add(F_Edge, theVertex);
|
||||
}
|
||||
|
||||
//Finds the edge connected to <theVertex> in the compound <theComp>
|
||||
//that is closest to bisector plane angularly.
|
||||
//Removes found edge from <theComp>
|
||||
//<theAxis> is the axis of bisector plane
|
||||
static TopoDS_Edge FindEdgeCloseToBisectorPlane(const TopoDS_Vertex& theVertex,
|
||||
TopoDS_Compound& theComp,
|
||||
const gp_Ax1& theAxis)
|
||||
{
|
||||
TopTools_IndexedDataMapOfShapeListOfShape VEmap;
|
||||
TopExp::MapShapesAndAncestors( theComp, TopAbs_VERTEX, TopAbs_EDGE, VEmap );
|
||||
|
||||
TopoDS_Edge MinEdge;
|
||||
if (!VEmap.Contains(theVertex))
|
||||
return MinEdge;
|
||||
|
||||
BRep_Builder BB;
|
||||
|
||||
const TopTools_ListOfShape& Edges = VEmap.FindFromKey(theVertex);
|
||||
if (Edges.Extent() == 1)
|
||||
MinEdge = TopoDS::Edge(Edges.First());
|
||||
else
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape itl(Edges);
|
||||
Standard_Real MinAngle = RealLast();
|
||||
for (; itl.More(); itl.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value());
|
||||
TopoDS_Wire aWire;
|
||||
BB.MakeWire(aWire);
|
||||
BB.Add(aWire, anEdge);
|
||||
gp_Pln aPln;
|
||||
Standard_Boolean issing;
|
||||
ComputeAveragePlaneAndMaxDeviation( aWire, aPln, issing );
|
||||
Standard_Real anAngle;
|
||||
if (issing) //edge is a segment of line
|
||||
{
|
||||
//<anAngle> is angle between <anEdge> and its projection on bisector plane
|
||||
BRepAdaptor_Curve BAcurve(anEdge);
|
||||
gp_Pnt FirstPnt = BAcurve.Value(BAcurve.FirstParameter());
|
||||
gp_Pnt LastPnt = BAcurve.Value(BAcurve.LastParameter());
|
||||
gp_Vec EdgeVec(FirstPnt, LastPnt);
|
||||
gp_Ax1 EdgeAxis(FirstPnt, EdgeVec);
|
||||
anAngle = EdgeAxis.Direction().Angle(theAxis.Direction());
|
||||
if (anAngle > M_PI/2)
|
||||
anAngle = M_PI - anAngle;
|
||||
anAngle = M_PI/2 - anAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
anAngle = aPln.Axis().Angle( theAxis );
|
||||
if (anAngle > M_PI/2)
|
||||
anAngle = M_PI - anAngle;
|
||||
}
|
||||
|
||||
if (anAngle < MinAngle)
|
||||
{
|
||||
MinAngle = anAngle;
|
||||
MinEdge = anEdge;
|
||||
}
|
||||
}
|
||||
} //else (more than one edge)
|
||||
|
||||
BB.Remove(theComp, MinEdge);
|
||||
return MinEdge;
|
||||
}
|
||||
|
||||
static Standard_Boolean FindMiddleEdges(const TopoDS_Vertex& theVertex1,
|
||||
const TopoDS_Vertex& theVertex2,
|
||||
const gp_Ax1& theAxis,
|
||||
TopoDS_Compound& theComp,
|
||||
TopTools_ListOfShape& theElist)
|
||||
{
|
||||
TopTools_IndexedDataMapOfShapeListOfShape VEmap;
|
||||
TopExp::MapShapesAndAncestors( theComp, TopAbs_VERTEX, TopAbs_EDGE, VEmap );
|
||||
if (VEmap.IsEmpty())
|
||||
return Standard_False;
|
||||
|
||||
if (!VEmap.Contains(theVertex1) ||
|
||||
!VEmap.Contains(theVertex2))
|
||||
return Standard_False;
|
||||
|
||||
TopoDS_Vertex CurVertex = theVertex1;
|
||||
for (;;)
|
||||
{
|
||||
TopoDS_Edge CurEdge;
|
||||
|
||||
CurEdge = FindEdgeCloseToBisectorPlane(CurVertex, theComp, theAxis);
|
||||
if (CurEdge.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(CurEdge, V1, V2);
|
||||
CurVertex = (V1.IsSame(CurVertex))? V2 : V1;
|
||||
|
||||
theElist.Append(CurEdge);
|
||||
if (CurVertex.IsSame(theVertex2))
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
static Standard_Boolean FindCommonVertex(const TopoDS_Edge& theFirstEdge,
|
||||
const TopoDS_Edge& theLastEdge,
|
||||
const TopoDS_Vertex& theFirstVertex,
|
||||
const TopoDS_Vertex& theLastVertex,
|
||||
TopoDS_Vertex& theCommonVertex)
|
||||
{
|
||||
if (!theFirstVertex.IsSame(theLastVertex))
|
||||
{
|
||||
Standard_Boolean CommonVertexExists = TopExp::CommonVertex(theFirstEdge,
|
||||
theLastEdge,
|
||||
theCommonVertex);
|
||||
return CommonVertexExists;
|
||||
}
|
||||
|
||||
TopoDS_Vertex V1, V2, V3, V4;
|
||||
TopExp::Vertices(theFirstEdge, V1, V2);
|
||||
TopExp::Vertices(theLastEdge, V3, V4);
|
||||
|
||||
if (V1.IsSame(theFirstVertex))
|
||||
{
|
||||
if (V2.IsSame(V3) ||
|
||||
V2.IsSame(V4))
|
||||
{
|
||||
theCommonVertex = V2;
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (V1.IsSame(V3) ||
|
||||
V1.IsSame(V4))
|
||||
{
|
||||
theCommonVertex = V1;
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepFill_TransitionStyle.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
@@ -28,13 +29,14 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <BOPDS_PDS.hxx>
|
||||
class gp_Ax2;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
//! Trims sets of faces in the corner to make proper parts of pipe
|
||||
class BRepFill_TrimShellCorner
|
||||
{
|
||||
public:
|
||||
@@ -42,12 +44,13 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces, const gp_Ax2& theAxeOfBisPlane, const TopoDS_Face& theSecPlane);
|
||||
|
||||
Standard_EXPORT BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces, const gp_Ax2& theAxeOfBisPlane, const TopoDS_Wire& theSpine, const TopoDS_Face& theSecPlane);
|
||||
|
||||
Standard_EXPORT void SetSpine (const TopoDS_Wire& theSpine);
|
||||
|
||||
//! Constructor: takes faces to intersect,
|
||||
//! type of transition (it can be RightCorner or RoundCorner)
|
||||
//! and axis of bisector plane
|
||||
Standard_EXPORT BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
|
||||
const BRepFill_TransitionStyle theTransition,
|
||||
const gp_Ax2& theAxeOfBisPlane);
|
||||
|
||||
Standard_EXPORT void AddBounds (const Handle(TopTools_HArray2OfShape)& Bounds);
|
||||
|
||||
Standard_EXPORT void AddUEdges (const Handle(TopTools_HArray2OfShape)& theUEdges);
|
||||
@@ -71,13 +74,29 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean MakeFacesSec(const Standard_Integer theIndex,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2,
|
||||
const Standard_Integer theSSInterfIndex);
|
||||
|
||||
Standard_Boolean MakeFacesNonSec(const Standard_Integer theIndex,
|
||||
const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theFaceIndex1,
|
||||
const Standard_Integer theFaceIndex2);
|
||||
|
||||
Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
|
||||
const TopoDS_Vertex& theFirstVertex,
|
||||
const TopoDS_Vertex& theLastVertex,
|
||||
TopoDS_Shape& resWire,
|
||||
gp_Pln& resPlane,
|
||||
Standard_Boolean& IsSingular);
|
||||
|
||||
|
||||
BRepFill_TransitionStyle myTransition;
|
||||
gp_Ax2 myAxeOfBisPlane;
|
||||
TopoDS_Shape myShape1;
|
||||
TopoDS_Shape myShape2;
|
||||
TopoDS_Wire mySpine;
|
||||
TopoDS_Face mySecPln;
|
||||
Handle(TopTools_HArray2OfShape) myBounds;
|
||||
Handle(TopTools_HArray2OfShape) myUEdges;
|
||||
Handle(TopTools_HArray2OfShape) myFaces;
|
||||
|
1794
src/BRepFill/BRepFill_Voluved.cxx
Normal file
1794
src/BRepFill/BRepFill_Voluved.cxx
Normal file
File diff suppressed because it is too large
Load Diff
106
src/BRepFill/BRepFill_Voluved.hxx
Normal file
106
src/BRepFill/BRepFill_Voluved.hxx
Normal file
@@ -0,0 +1,106 @@
|
||||
// Created on: 2018-03-14
|
||||
// Created by: Nikolai BUKHALOV
|
||||
// Copyright (c) 1999-2018 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepFill_Voluved_HeaderFile
|
||||
#define _BRepFill_Voluved_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class BOPAlgo_MakerVolume;
|
||||
|
||||
//! Constructs an evolved volume from a spine (wire or face)
|
||||
//! and a profile ( wire).
|
||||
class BRepFill_Voluved
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT BRepFill_Voluved() :myErrorStatus(BRepFill_Voluved_Empty),
|
||||
myFuzzyValue(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_EXPORT void Perform(const TopoDS_Wire& theSpine, const TopoDS_Wire& theProfile, const Standard_Real theTolerance, const Standard_Boolean theSolidReq = Standard_True);
|
||||
|
||||
Standard_Boolean IsDone(unsigned int* theErrorCode = 0) const
|
||||
{
|
||||
if (theErrorCode)
|
||||
*theErrorCode = myErrorStatus;
|
||||
|
||||
return (myErrorStatus == BRepFill_Voluved_OK);
|
||||
}
|
||||
|
||||
//! returns the resulting shape.
|
||||
const TopoDS_Shape& Shape() const
|
||||
{
|
||||
return myResult;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Standard_EXPORT void PerformSweep();
|
||||
|
||||
Standard_EXPORT void GetLids();
|
||||
|
||||
Standard_EXPORT void BuildSolid();
|
||||
|
||||
Standard_EXPORT void RemoveExcessSolids(const TopTools_ListOfShape& theLSplits,
|
||||
TopoDS_Shape& theShape,
|
||||
TopTools_ListOfShape& theArgsList,
|
||||
BOPAlgo_MakerVolume& theMV);
|
||||
|
||||
Standard_EXPORT void ExtractOuterSolid(TopoDS_Shape& theShape,
|
||||
TopTools_ListOfShape& theArgsList);
|
||||
|
||||
Standard_EXPORT void GetSpineAndProfile(const TopoDS_Wire& theSpine,
|
||||
const TopoDS_Wire& theProfile);
|
||||
|
||||
private:
|
||||
|
||||
enum
|
||||
{
|
||||
BRepFill_Voluved_Empty = 0,
|
||||
BRepFill_Voluved_NotPlanarSpine,
|
||||
BRepFill_Voluved_SweepError,
|
||||
BRepFill_Voluved_NoLids,
|
||||
BRepFill_Voluved_NotSolid,
|
||||
BRepFill_Voluved_NotVolume,
|
||||
BRepFill_Voluved_OK = UINT_MAX
|
||||
} myErrorStatus;
|
||||
|
||||
TopoDS_Wire mySpine;
|
||||
TopoDS_Wire myProfile;
|
||||
TopoDS_Shape myPipeShell;
|
||||
TopoDS_Compound myTopBottom; // Lids can be split on several faces
|
||||
TopoDS_Shape myResult;
|
||||
Standard_Real myFuzzyValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepFill_Voluved_HeaderFile
|
@@ -83,3 +83,5 @@ BRepFill_TrimShellCorner.hxx
|
||||
BRepFill_TrimSurfaceTool.cxx
|
||||
BRepFill_TrimSurfaceTool.hxx
|
||||
BRepFill_TypeOfContact.hxx
|
||||
BRepFill_Voluved.cxx
|
||||
BRepFill_Voluved.hxx
|
@@ -361,9 +361,12 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
|
||||
case GeomAbs_Ellipse:
|
||||
case GeomAbs_Hyperbola:
|
||||
case GeomAbs_Parabola:
|
||||
// Two points on straight segment, Four points on otheranalitical curves
|
||||
iNbPoints = (c.GetType() == GeomAbs_Line ? 2 : 4);
|
||||
Standard_FALLTHROUGH
|
||||
if (c.GetType() == GeomAbs_Line)
|
||||
// Two points on straight segment
|
||||
iNbPoints=2;
|
||||
else
|
||||
// Four points on otheranalitical curves
|
||||
iNbPoints=4;
|
||||
default:
|
||||
{
|
||||
// Put some points on other curves
|
||||
|
@@ -437,7 +437,6 @@ static
|
||||
static
|
||||
void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theOENEdges,
|
||||
const TopTools_MapOfShape& theMVBounds,
|
||||
const TopoDS_Shape& theSolids,
|
||||
const TopTools_IndexedMapOfShape& theInvEdges,
|
||||
@@ -463,26 +462,27 @@ static
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopTools_MapOfShape& theMEB,
|
||||
TopTools_MapOfShape& theMVOld,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopTools_ListOfShape& theLENew,
|
||||
BOPCol_ListOfShape& theLA,
|
||||
TopTools_DataMapOfShapeListOfShape& theDMEOr,
|
||||
TopTools_DataMapOfShapeListOfShape& theMELF);
|
||||
|
||||
static
|
||||
void IntersectEdges(const BOPCol_ListOfShape& theLA,
|
||||
const TopTools_ListOfShape& theLE,
|
||||
const TopTools_ListOfShape& theLENew,
|
||||
const TopTools_MapOfShape& theMVBounds,
|
||||
const TopTools_MapOfShape& theVertsToAvoid,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopTools_MapOfShape& theMECheckExt,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopTools_MapOfShape& theModifiedEdges,
|
||||
TopTools_DataMapOfShapeListOfShape& theDMEOr,
|
||||
TopTools_DataMapOfShapeListOfShape& theMELF,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopoDS_Shape& theSplits);
|
||||
|
||||
static
|
||||
void GetBounds(const TopTools_ListOfShape& theLFaces,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
const TopTools_MapOfShape& theMEB,
|
||||
TopoDS_Shape& theBounds);
|
||||
|
||||
@@ -509,17 +509,9 @@ static
|
||||
const TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
const TopTools_MapOfShape& theMECheckExt,
|
||||
const TopTools_MapOfShape& theMEInvOnArt,
|
||||
Handle(IntTools_Context)& theCtx,
|
||||
TopTools_MapOfShape& theVertsToAvoid,
|
||||
TopTools_MapOfShape& theMEInv);
|
||||
|
||||
static
|
||||
void FilterSplits(const TopTools_ListOfShape& theLE,
|
||||
const TopTools_MapOfShape& theMEFilter,
|
||||
const Standard_Boolean theIsInv,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopoDS_Shape& theSplits);
|
||||
|
||||
static
|
||||
void UpdateNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
const TopTools_DataMapOfShapeListOfShape& theMELF,
|
||||
@@ -3967,11 +3959,7 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui
|
||||
// Splits of the new edges
|
||||
TopTools_DataMapOfShapeListOfShape aEImages;
|
||||
BRep_Builder aBB;
|
||||
|
||||
// Keep connection between blocks of invalid edges to the lists of
|
||||
// found edges to be intersected for its treatment
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aDMOENEdges;
|
||||
|
||||
//
|
||||
aNbInv = theInvFaces.Extent();
|
||||
for (k = 1; k <= aNbInv; ++k) {
|
||||
const TopoDS_Shape& aFInv = theInvFaces.FindKey(k);
|
||||
@@ -4128,20 +4116,12 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui
|
||||
// intersect and trim edges for this chain
|
||||
IntersectAndTrimEdges(theFToRebuild, aMFInt, aMEToInt, aDMEETrim, aME, aMECV,
|
||||
aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages);
|
||||
//
|
||||
TopTools_ListOfShape aLEToInt;
|
||||
Standard_Integer iE, aNbEToInt = aMEToInt.Extent();
|
||||
for (iE = 1; iE <= aNbEToInt; ++iE)
|
||||
aLEToInt.Append(aMEToInt(iE));
|
||||
TopExp_Explorer aExpE(aCBELoc, TopAbs_EDGE);
|
||||
for (; aExpE.More(); aExpE.Next())
|
||||
aDMOENEdges.Add(aExpE.Current(), aLEToInt);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// filter the obtained edges
|
||||
UpdateValidEdges(theFImages, aFLE, aDMOENEdges, aMVBounds, theSolids, theInvEdges, theInvertedEdges, aMEInvOnArt,
|
||||
UpdateValidEdges(theFImages, aFLE, aMVBounds, theSolids, theInvEdges, theInvertedEdges, aMEInvOnArt,
|
||||
aMECheckExt, theEdgesToAvoid, theEdgesOrigins, theOEImages, theOEOrigins,
|
||||
theVertsToAvoid, theETrimEInf, aEImages, aDMEETrim, theModifiedEdges, theAsDes);
|
||||
}
|
||||
@@ -4823,7 +4803,7 @@ void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theF
|
||||
TopTools_ListOfShape aLENew;
|
||||
// get edges to intersect
|
||||
TopTools_ListOfShape aLEInt;
|
||||
// Common intersection edges. Should be intersected separately
|
||||
// Common intersection edges. Should be intersected separetely
|
||||
TopTools_ListOfShape aLCE;
|
||||
//
|
||||
aNb = theMEInt.Extent();
|
||||
@@ -5043,7 +5023,6 @@ void GetInvalidEdges(const TopTools_MapOfShape& theVertsToAvoid,
|
||||
//=======================================================================
|
||||
void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theFLE,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theOENEdges,
|
||||
const TopTools_MapOfShape& theMVBounds,
|
||||
const TopoDS_Shape& theSolids,
|
||||
const TopTools_IndexedMapOfShape& theInvEdges,
|
||||
@@ -5099,6 +5078,7 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage
|
||||
TopTools_MapOfShape aMEB;
|
||||
//
|
||||
// new intersection edges
|
||||
TopTools_ListOfShape aLENew;
|
||||
TopTools_MapOfShape aMENew;
|
||||
// map of old vertices
|
||||
TopTools_MapOfShape aMVOld;
|
||||
@@ -5106,219 +5086,78 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage
|
||||
TopTools_DataMapOfShapeListOfShape aDMEOr;
|
||||
//
|
||||
// trim the new intersection edges
|
||||
TrimNewIntersectionEdges(aLE, theEETrim, theMVBounds, theMECheckExt,
|
||||
theEImages, aMEB, aMVOld, aMENew, aDMEOr, aMELF);
|
||||
BOPCol_ListOfShape aLA;
|
||||
TrimNewIntersectionEdges(aLE, theEETrim, theMVBounds, theMECheckExt, theEImages,
|
||||
aMEB, aMVOld, aLENew, aLA, aDMEOr, aMELF);
|
||||
//
|
||||
if (theEImages.IsEmpty())
|
||||
{
|
||||
// No new splits is preserved
|
||||
// update intersection edges and exit
|
||||
UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins,
|
||||
theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes);
|
||||
return;
|
||||
}
|
||||
|
||||
BRep_Builder aBB;
|
||||
|
||||
// Make connexity blocks of the invalid edges
|
||||
// and treat each block separately
|
||||
|
||||
// Compound of all invalid edges to make the blocks
|
||||
TopoDS_Compound aCEAll;
|
||||
aBB.MakeCompound(aCEAll);
|
||||
|
||||
Standard_Integer aNbE = theOENEdges.Extent();
|
||||
for (i = 1; i <= aNbE; ++i)
|
||||
aBB.Add(aCEAll, theOENEdges.FindKey(i));
|
||||
|
||||
// Separate the edges into blocks
|
||||
TopTools_ListOfShape aLBlocks;
|
||||
BOPTools_AlgoTools::MakeConnexityBlocks(aCEAll, TopAbs_VERTEX, TopAbs_EDGE, aLBlocks);
|
||||
|
||||
// Perform intersection of the new splits for each block
|
||||
|
||||
// Intersected splits
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMBlocksSp;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLB(aLBlocks);
|
||||
for (; aItLB.More(); aItLB.Next())
|
||||
{
|
||||
const TopoDS_Shape& aBlock = aItLB.Value();
|
||||
|
||||
// Get the list of new edges for the block
|
||||
TopTools_ListOfShape aBlockLENew;
|
||||
{
|
||||
// Fence map
|
||||
TopTools_MapOfShape aMEFence;
|
||||
TopExp_Explorer anExpE(aBlock, TopAbs_EDGE);
|
||||
for (; anExpE.More(); anExpE.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = anExpE.Current();
|
||||
const TopTools_ListOfShape& aLEInt = theOENEdges.FindFromKey(aE);
|
||||
TopTools_ListIteratorOfListOfShape aItLEInt(aLEInt);
|
||||
for (; aItLEInt.More(); aItLEInt.Next())
|
||||
{
|
||||
if (aMEFence.Add(aItLEInt.Value()))
|
||||
aBlockLENew.Append(aItLEInt.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aBlockLENew.IsEmpty())
|
||||
continue;
|
||||
|
||||
// Get the splits of new edges to intersect
|
||||
BOPCol_ListOfShape aLSplits;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLE(aBlockLENew);
|
||||
for (; aItLE.More(); aItLE.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = aItLE.Value();
|
||||
TopTools_ListOfShape* pLEIm = theEImages.ChangeSeek(aE);
|
||||
if (!pLEIm || pLEIm->IsEmpty())
|
||||
continue;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
|
||||
for (; aItLEIm.More(); aItLEIm.Next())
|
||||
aLSplits.Append(aItLEIm.Value());
|
||||
}
|
||||
|
||||
if (aLSplits.IsEmpty())
|
||||
continue;
|
||||
|
||||
TopoDS_Shape aCE;
|
||||
if (aLSplits.Extent() > 1)
|
||||
// Intersect the new splits among themselves to avoid self-intersections
|
||||
IntersectEdges(aLSplits, aBlockLENew, theMVBounds, theVertsToAvoid, aMENew, theMECheckExt,
|
||||
theEImages, theModifiedEdges, aDMEOr, aMELF, aCE);
|
||||
else
|
||||
aCE = aLSplits.First();
|
||||
|
||||
aMBlocksSp.Add(aCE, aBlockLENew);
|
||||
}
|
||||
|
||||
// Perform filtering of the edges in two steps:
|
||||
// - Check each block separately using localized bounds
|
||||
// taken only from the splits of faces of the current block;
|
||||
// - Intersect all splits together and filter the splits by all bounds.
|
||||
|
||||
// FIRST STAGE - separate treatment of the blocks
|
||||
|
||||
// Valid splits to be preserved on the first stage
|
||||
TopTools_MapOfShape aMEVal;
|
||||
|
||||
// Blocks of valid edges on the first stage
|
||||
BOPCol_ListOfShape aLValBlocks;
|
||||
|
||||
// Context for caching the classification tools
|
||||
Handle(IntTools_Context) aCtx = new IntTools_Context;
|
||||
|
||||
Standard_Integer aNbB = aMBlocksSp.Extent();
|
||||
for (i = 1; i <= aNbB; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aCE = aMBlocksSp.FindKey(i);
|
||||
const TopTools_ListOfShape& aBlockLENew = aMBlocksSp(i);
|
||||
|
||||
// Get all participating faces to get the bounds
|
||||
TopTools_ListOfShape aLFaces;
|
||||
TopTools_ListIteratorOfListOfShape aItLE(aBlockLENew);
|
||||
for (; aItLE.More(); aItLE.Next())
|
||||
{
|
||||
const TopTools_ListOfShape *pLF = aMELF.Seek(aItLE.Value());
|
||||
if (!pLF)
|
||||
continue;
|
||||
TopTools_ListIteratorOfListOfShape aItLF(*pLF);
|
||||
for (; aItLF.More(); aItLF.Next())
|
||||
AppendToList(aLFaces, aItLF.Value());
|
||||
}
|
||||
|
||||
// Localized bounds of the splits of the offset faces
|
||||
// to filter the new splits of the current block
|
||||
TopoDS_Shape aFilterBounds;
|
||||
GetBounds(aLFaces, theFImages, aMEB, aFilterBounds);
|
||||
|
||||
// Filter the splits by bounds
|
||||
TopTools_MapOfShape aMEInvLoc;
|
||||
GetInvalidEdgesByBounds(aCE, aFilterBounds, theFImages, theSolids,
|
||||
theInvEdges, aMVOld, aMENew, aDMEOr, aMELF, theEImages,
|
||||
theMECheckExt, theMEInvOnArt, aCtx, theVertsToAvoid, aMEInvLoc);
|
||||
|
||||
// Keep only valid edges of the block
|
||||
TopoDS_Compound aCEVal;
|
||||
aBB.MakeCompound(aCEVal);
|
||||
|
||||
Standard_Boolean bKept = Standard_False;
|
||||
|
||||
TopExp_Explorer anExpE(aCE, TopAbs_EDGE);
|
||||
for (; anExpE.More(); anExpE.Next())
|
||||
{
|
||||
const TopoDS_Shape& aESp = anExpE.Current();
|
||||
if (!aMEInvLoc.Contains(aESp) && aMEVal.Add(aESp))
|
||||
{
|
||||
aBB.Add(aCEVal, aESp);
|
||||
bKept = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
if (bKept)
|
||||
aLValBlocks.Append(aCEVal);
|
||||
}
|
||||
|
||||
// Filter the images of edges after the first filtering stage
|
||||
TopoDS_Shape aSplits1;
|
||||
FilterSplits(aLE, aMEVal, Standard_False, theEImages, aSplits1);
|
||||
|
||||
if (aLValBlocks.IsEmpty())
|
||||
{
|
||||
if (aLA.IsEmpty()) {
|
||||
// update intersection edges
|
||||
UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins,
|
||||
theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes);
|
||||
return;
|
||||
}
|
||||
|
||||
// SECOND STAGE - Filter the remaining splits together
|
||||
|
||||
// Add for intersection already removed new edges using them
|
||||
// as markers for other invalid edges
|
||||
aNbB = aMBlocksSp.Extent();
|
||||
for (i = 1; i <= aNbB; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aCE = aMBlocksSp.FindKey(i);
|
||||
for (TopExp_Explorer anExp(aCE, TopAbs_EDGE); anExp.More(); anExp.Next())
|
||||
{
|
||||
const TopoDS_Shape& aEIm = anExp.Current();
|
||||
if (aMENew.Contains(aEIm) && !aMEVal.Contains(aEIm))
|
||||
aLValBlocks.Append(aEIm);
|
||||
}
|
||||
}
|
||||
|
||||
if (aLValBlocks.Extent() > 1)
|
||||
//
|
||||
TopoDS_Shape aSplits1;
|
||||
if (aLA.Extent() > 1) {
|
||||
// intersect the new splits among themselves to avoid self-intersections
|
||||
IntersectEdges(aLValBlocks, aLE, theMVBounds, theVertsToAvoid, aMENew, theMECheckExt,
|
||||
theEImages, theModifiedEdges, aDMEOr, aMELF, aSplits1);
|
||||
else
|
||||
aSplits1 = aLValBlocks.First();
|
||||
|
||||
// Get all faces to get the bounds from their splits
|
||||
TopTools_ListOfShape aLFaces;
|
||||
for (i = 1; i <= theFImages.Extent(); ++i)
|
||||
aLFaces.Append(theFImages.FindKey(i));
|
||||
|
||||
// Bounds of the splits of the offset faces to filter the new splits
|
||||
IntersectEdges(aLA, aLE, aLENew, theMVBounds, theVertsToAvoid, theMECheckExt,
|
||||
theEImages, theModifiedEdges, aDMEOr, aMELF, aMENew, aSplits1);
|
||||
}
|
||||
else {
|
||||
aSplits1 = aLA.First();
|
||||
}
|
||||
//
|
||||
// filter the new splits with bounds
|
||||
TopoDS_Shape aFilterBounds;
|
||||
GetBounds(aLFaces, theFImages, aMEB, aFilterBounds);
|
||||
|
||||
// Filter the splits by intersection with bounds
|
||||
GetBounds(theFImages, aMEB, aFilterBounds);
|
||||
//
|
||||
// intersect splits and bounds and remove those splits which have pure E/E intersection
|
||||
TopTools_MapOfShape aMEInv;
|
||||
GetInvalidEdgesByBounds(aSplits1, aFilterBounds, theFImages, theSolids,
|
||||
theInvEdges, aMVOld, aMENew, aDMEOr, aMELF, theEImages,
|
||||
theMECheckExt, theMEInvOnArt, aCtx, theVertsToAvoid, aMEInv);
|
||||
|
||||
// Filter the images of edges after the second filtering stage
|
||||
// and combine all valid edges into a single compound
|
||||
theMECheckExt, theMEInvOnArt, theVertsToAvoid, aMEInv);
|
||||
//
|
||||
// get valid edges only
|
||||
TopoDS_Shape aSplits;
|
||||
FilterSplits(aLE, aMEInv, Standard_True, theEImages, aSplits);
|
||||
|
||||
if (aMEInv.Extent()) {
|
||||
// clear images from found invalid edges
|
||||
TopoDS_Compound aSp;
|
||||
BRep_Builder().MakeCompound(aSp);
|
||||
TopTools_MapOfShape aMFence;
|
||||
//
|
||||
TopTools_ListIteratorOfListOfShape aItLE(aLE);
|
||||
for (; aItLE.More(); aItLE.Next()) {
|
||||
const TopoDS_Shape& aE = aItLE.Value();
|
||||
//
|
||||
TopTools_ListOfShape* pLEIm = theEImages.ChangeSeek(aE);
|
||||
if (!pLEIm) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
|
||||
for (; aItLEIm.More();) {
|
||||
const TopoDS_Shape& aEIm = aItLEIm.Value();
|
||||
if (aMEInv.Contains(aEIm)) {
|
||||
pLEIm->Remove(aItLEIm);
|
||||
}
|
||||
else {
|
||||
if (aMFence.Add(aEIm)) {
|
||||
BRep_Builder().Add(aSp, aEIm);
|
||||
}
|
||||
aItLEIm.Next();
|
||||
}
|
||||
}
|
||||
//
|
||||
if (pLEIm->IsEmpty()) {
|
||||
theEImages.UnBind(aE);
|
||||
}
|
||||
}
|
||||
aSplits = aSp;
|
||||
}
|
||||
else {
|
||||
aSplits = aSplits1;
|
||||
}
|
||||
//
|
||||
// get bounds to update
|
||||
// we need to update the edges of all the affected faces
|
||||
TopTools_ListOfShape aLF;
|
||||
@@ -5399,7 +5238,7 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbE = theEdgesToAvoid.Extent();
|
||||
Standard_Integer aNbE = theEdgesToAvoid.Extent();
|
||||
for (i = 1; i <= aNbE; ++i) {
|
||||
const TopoDS_Shape& aE = theEdgesToAvoid(i);
|
||||
const TopTools_ListOfShape& aLEIm = aGF.Modified(aE);
|
||||
@@ -5424,7 +5263,8 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopTools_MapOfShape& theMEB,
|
||||
TopTools_MapOfShape& theMVOld,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopTools_ListOfShape& theLENew,
|
||||
BOPCol_ListOfShape& theLA,
|
||||
TopTools_DataMapOfShapeListOfShape& theDMEOr,
|
||||
TopTools_DataMapOfShapeListOfShape& theMELF)
|
||||
{
|
||||
@@ -5520,6 +5360,7 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
}
|
||||
//
|
||||
if (!aItV.More()) {
|
||||
theLA.Append(aEIm);
|
||||
aLEIm.Append(aEIm);
|
||||
//
|
||||
theDMEOr.Bound(aEIm, TopTools_ListOfShape())->Append(aE);
|
||||
@@ -5547,7 +5388,7 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
theMECheckExt.Add(aEIm);
|
||||
}
|
||||
else if (!bOld) {
|
||||
theMENew.Add(aEIm);
|
||||
theLENew.Append(aEIm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5560,14 +5401,15 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
//=======================================================================
|
||||
void IntersectEdges(const BOPCol_ListOfShape& theLA,
|
||||
const TopTools_ListOfShape& theLE,
|
||||
const TopTools_ListOfShape& theLENew,
|
||||
const TopTools_MapOfShape& theMVBounds,
|
||||
const TopTools_MapOfShape& theVertsToAvoid,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopTools_MapOfShape& theMECheckExt,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopTools_MapOfShape& theModifiedEdges,
|
||||
TopTools_DataMapOfShapeListOfShape& theDMEOr,
|
||||
TopTools_DataMapOfShapeListOfShape& theMELF,
|
||||
TopTools_MapOfShape& theMENew,
|
||||
TopoDS_Shape& theSplits)
|
||||
{
|
||||
BOPAlgo_Builder aGFA;
|
||||
@@ -5592,36 +5434,26 @@ void IntersectEdges(const BOPCol_ListOfShape& theLA,
|
||||
// compound of valid splits
|
||||
theSplits = aGFA.Shape();
|
||||
//
|
||||
TopTools_ListIteratorOfListOfShape aIt, aIt1;
|
||||
|
||||
// prepare list of edges to update
|
||||
TopTools_ListOfShape aLEInput;
|
||||
for (aIt.Initialize(theLA); aIt.More(); aIt.Next())
|
||||
{
|
||||
TopExp_Explorer anExpE(aIt.Value(), TopAbs_EDGE);
|
||||
for (; anExpE.More(); anExpE.Next())
|
||||
aLEInput.Append(anExpE.Current());
|
||||
}
|
||||
|
||||
// update new edges
|
||||
aIt.Initialize(aLEInput);
|
||||
TopTools_ListIteratorOfListOfShape aIt, aIt1;
|
||||
aIt.Initialize(theLENew);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
if (!theMENew.Contains(aE))
|
||||
continue;
|
||||
|
||||
const TopTools_ListOfShape& aLEIm = aGFA.Modified(aE);
|
||||
if (aLEIm.IsEmpty())
|
||||
continue;
|
||||
|
||||
theMENew.Remove(aE);
|
||||
aIt1.Initialize(aLEIm);
|
||||
for (; aIt1.More(); aIt1.Next())
|
||||
theMENew.Add(aIt1.Value());
|
||||
if (aLEIm.Extent()) {
|
||||
aIt1.Initialize(aLEIm);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
const TopoDS_Shape& aEIm = aIt1.Value();
|
||||
theMENew.Add(aEIm);
|
||||
}
|
||||
}
|
||||
else {
|
||||
theMENew.Add(aE);
|
||||
}
|
||||
}
|
||||
//
|
||||
// update edges after intersection for extended checking
|
||||
aIt.Initialize(aLEInput);
|
||||
aIt.Initialize(theLA);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
const TopTools_ListOfShape& aLEIm = aGFA.Modified(aE);
|
||||
@@ -5669,40 +5501,33 @@ void IntersectEdges(const BOPCol_ListOfShape& theLA,
|
||||
theSplits = aSp;
|
||||
}
|
||||
//
|
||||
// update origins
|
||||
UpdateOrigins(aLEInput, theDMEOr, aGFA);
|
||||
UpdateOrigins(theLA, theDMEOr, aGFA);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetBounds
|
||||
//purpose : Getting edges from the splits of offset faces
|
||||
//=======================================================================
|
||||
void GetBounds(const TopTools_ListOfShape& theLFaces,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
const TopTools_MapOfShape& theMEB,
|
||||
TopoDS_Shape& theBounds)
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
// Make compound of edges contained in the splits of faces
|
||||
// make compound of edges contained in the splits of faces
|
||||
TopoDS_Compound aBounds;
|
||||
BRep_Builder aBB;
|
||||
aBB.MakeCompound(aBounds);
|
||||
// Fence map
|
||||
//
|
||||
TopTools_MapOfShape aMFence;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLF(theLFaces);
|
||||
for (; aItLF.More(); aItLF.Next())
|
||||
{
|
||||
const TopTools_ListOfShape* pLFIm = theFImages.Seek(aItLF.Value());
|
||||
if (!pLFIm)
|
||||
continue;
|
||||
TopTools_ListIteratorOfListOfShape aIt(*pLFIm);
|
||||
for (; aIt.More(); aIt.Next())
|
||||
{
|
||||
//
|
||||
Standard_Integer i, aNb = theFImages.Extent();
|
||||
for (i = 1; i <= aNb; ++i) {
|
||||
const TopTools_ListOfShape& aLFIm = theFImages(i);
|
||||
TopTools_ListIteratorOfListOfShape aIt(aLFIm);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aFIm = aIt.Value();
|
||||
//
|
||||
TopExp_Explorer aExpE(aFIm, TopAbs_EDGE);
|
||||
for (; aExpE.More(); aExpE.Next())
|
||||
{
|
||||
for (; aExpE.More(); aExpE.Next()) {
|
||||
const TopoDS_Shape& aEIm = aExpE.Current();
|
||||
if (!theMEB.Contains(aEIm) && aMFence.Add(aEIm)) {
|
||||
aBB.Add(aBounds, aEIm);
|
||||
@@ -5801,7 +5626,6 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
const TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
const TopTools_MapOfShape& theMECheckExt,
|
||||
const TopTools_MapOfShape& theMEInvOnArt,
|
||||
Handle(IntTools_Context)& theCtx,
|
||||
TopTools_MapOfShape& theVertsToAvoid,
|
||||
TopTools_MapOfShape& theMEInv)
|
||||
{
|
||||
@@ -5858,10 +5682,8 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
for (; aItLEOr.More(); aItLEOr.Next()) {
|
||||
const TopoDS_Shape& aEOr = aItLEOr.Value();
|
||||
//
|
||||
const TopTools_ListOfShape *pLEIm = theEImages.Seek(aEOr);
|
||||
if (!pLEIm)
|
||||
continue;
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
|
||||
const TopTools_ListOfShape& aLEIm = theEImages.Find(aEOr);
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm);
|
||||
for (; aItLEIm.More(); aItLEIm.Next()) {
|
||||
const TopoDS_Shape& aEIm = aItLEIm.Value();
|
||||
//
|
||||
@@ -5982,7 +5804,9 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
}
|
||||
}
|
||||
//
|
||||
// perform the checking of the vertices
|
||||
// perform the checking
|
||||
Handle(IntTools_Context) aCtx = new IntTools_Context;
|
||||
// filter vertices
|
||||
Standard_Integer iv, aNbIV = aMVInv.Extent();
|
||||
for (iv = 1; iv <= aNbIV; ++iv) {
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(aMVInv(iv));
|
||||
@@ -6026,14 +5850,14 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
//
|
||||
if (bInvalid) {
|
||||
Standard_Real U, V, aTol;
|
||||
Standard_Integer iStatus = theCtx->ComputeVF(aV, aF, U, V, aTol);
|
||||
Standard_Integer iStatus = aCtx->ComputeVF(aV, aF, U, V, aTol);
|
||||
if (!iStatus) {
|
||||
// classify the point relatively faces
|
||||
gp_Pnt2d aP2d(U, V);
|
||||
aItLF.Initialize(aLFIm);
|
||||
for (; aItLF.More() && bInvalid; aItLF.Next()) {
|
||||
const TopoDS_Face& aFIm = TopoDS::Face(aItLF.Value());
|
||||
bInvalid = !theCtx->IsPointInOnFace(aFIm, aP2d);
|
||||
bInvalid = !aCtx->IsPointInOnFace(aFIm, aP2d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6048,7 +5872,7 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
TopExp_Explorer aExpS(theSolids, TopAbs_SOLID);
|
||||
for (; aExpS.More() && bInvalid; aExpS.Next()) {
|
||||
const TopoDS_Solid& aSol = TopoDS::Solid(aExpS.Current());
|
||||
BRepClass3d_SolidClassifier& aSC = theCtx->SolidClassifier(aSol);
|
||||
BRepClass3d_SolidClassifier& aSC = aCtx->SolidClassifier(aSol);
|
||||
aSC.Perform(aP, aTolV);
|
||||
bInvalid = (aSC.State() == TopAbs_OUT);
|
||||
}
|
||||
@@ -6064,49 +5888,6 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FilterSplits
|
||||
//purpose : Filter the images of edges from the invalid edges
|
||||
//=======================================================================
|
||||
void FilterSplits(const TopTools_ListOfShape& theLE,
|
||||
const TopTools_MapOfShape& theMEFilter,
|
||||
const Standard_Boolean theIsInv,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages,
|
||||
TopoDS_Shape& theSplits)
|
||||
{
|
||||
TopoDS_Compound aSplits;
|
||||
BRep_Builder().MakeCompound(aSplits);
|
||||
TopTools_MapOfShape aMFence;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLE(theLE);
|
||||
for (; aItLE.More(); aItLE.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = aItLE.Value();
|
||||
TopTools_ListOfShape *pLEIm = theEImages.ChangeSeek(aE);
|
||||
if (!pLEIm)
|
||||
continue;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
|
||||
for (; aItLEIm.More();)
|
||||
{
|
||||
const TopoDS_Shape& aEIm = aItLEIm.Value();
|
||||
if (theMEFilter.Contains(aEIm) == theIsInv)
|
||||
{
|
||||
pLEIm->Remove(aItLEIm);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aMFence.Add(aEIm))
|
||||
BRep_Builder().Add(aSplits, aEIm);
|
||||
aItLEIm.Next();
|
||||
}
|
||||
|
||||
if (pLEIm->IsEmpty())
|
||||
theEImages.UnBind(aE);
|
||||
}
|
||||
theSplits = aSplits;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UpdateNewIntersectionEdges
|
||||
//purpose : Updating the maps of images and origins of the offset edges
|
||||
|
@@ -22,6 +22,8 @@
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepOffsetAPI_MakeEvolved
|
||||
@@ -43,19 +45,29 @@ BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Wire& Spin
|
||||
const Standard_Boolean AxeProf,
|
||||
const Standard_Boolean Solid,
|
||||
const Standard_Boolean ProfOnSpine,
|
||||
const Standard_Real Tol)
|
||||
const Standard_Boolean theIsVolume,
|
||||
const Standard_Real Tol)
|
||||
{
|
||||
gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
|
||||
gp_Dir(0.,0.,1.),
|
||||
gp_Dir(1.,0.,0.));
|
||||
if (theIsVolume)
|
||||
{
|
||||
myVolume.Perform(Spine, Profil, Tol);
|
||||
}
|
||||
else
|
||||
{
|
||||
gp_Ax3 Axis(gp_Pnt(0., 0., 0.),
|
||||
gp_Dir(0., 0., 1.),
|
||||
gp_Dir(1., 0., 0.));
|
||||
|
||||
if ( !AxeProf) {
|
||||
Standard_Boolean POS;
|
||||
BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
|
||||
if (ProfOnSpine && !POS) return;
|
||||
if (!AxeProf)
|
||||
{
|
||||
Standard_Boolean POS;
|
||||
BRepFill::Axe(Spine, Profil, Axis, POS, Max(Tol, Precision::Confusion()));
|
||||
if (ProfOnSpine && !POS) return;
|
||||
}
|
||||
|
||||
myEvolved.Perform(Spine, Profil, Axis, Join, Solid);
|
||||
}
|
||||
|
||||
myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
|
||||
Build();
|
||||
Done();
|
||||
}
|
||||
@@ -72,20 +84,31 @@ BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Face& Spin
|
||||
const Standard_Boolean AxeProf,
|
||||
const Standard_Boolean Solid,
|
||||
const Standard_Boolean ProfOnSpine,
|
||||
const Standard_Real Tol)
|
||||
const Standard_Boolean theIsVolume,
|
||||
const Standard_Real Tol)
|
||||
{
|
||||
gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
|
||||
gp_Dir(0.,0.,1.),
|
||||
gp_Dir(1.,0.,0.));
|
||||
if (theIsVolume)
|
||||
{
|
||||
myVolume.Perform(TopoDS::Wire(TopoDS_Iterator(Spine).Value()), Profil, Tol);
|
||||
}
|
||||
else
|
||||
{
|
||||
gp_Ax3 Axis(gp_Pnt(0., 0., 0.),
|
||||
gp_Dir(0., 0., 1.),
|
||||
gp_Dir(1., 0., 0.));
|
||||
|
||||
if ( !AxeProf) {
|
||||
Standard_Boolean POS;
|
||||
BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
|
||||
if (ProfOnSpine && !POS) return;
|
||||
if (!AxeProf)
|
||||
{
|
||||
Standard_Boolean POS;
|
||||
BRepFill::Axe(Spine, Profil, Axis, POS, Max(Tol, Precision::Confusion()));
|
||||
if (ProfOnSpine && !POS) return;
|
||||
}
|
||||
|
||||
myEvolved.Perform(Spine, Profil, Axis, Join, Solid);
|
||||
}
|
||||
|
||||
myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
|
||||
Build();
|
||||
Done();
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +130,16 @@ const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const
|
||||
|
||||
void BRepOffsetAPI_MakeEvolved::Build()
|
||||
{
|
||||
myShape = myEvolved.Shape();
|
||||
if (myEvolved.IsDone()) Done();
|
||||
if (myEvolved.IsDone())
|
||||
{
|
||||
myShape = myEvolved.Shape();
|
||||
}
|
||||
else if (myVolume.IsDone())
|
||||
{
|
||||
myShape = myVolume.Shape();
|
||||
}
|
||||
|
||||
Done();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepFill_Evolved.hxx>
|
||||
#include <BRepFill_Voluved.hxx>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
#include <GeomAbs_JoinType.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
@@ -66,7 +67,7 @@ public:
|
||||
|
||||
Standard_EXPORT BRepOffsetAPI_MakeEvolved();
|
||||
|
||||
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Wire& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean AxeProf = Standard_True, const Standard_Boolean Solid = Standard_False, const Standard_Boolean ProfOnSpine = Standard_False, const Standard_Real Tol = 0.0000001);
|
||||
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Wire& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join/* = GeomAbs_Arc*/, const Standard_Boolean AxeProf/* = Standard_True*/, const Standard_Boolean Solid/* = Standard_False*/, const Standard_Boolean ProfOnSpine/* = Standard_False*/, const Standard_Boolean theIsVolume, const Standard_Real Tol/* = Precision::Confusion()*/);
|
||||
|
||||
//! These constructors construct an evolved shape by sweeping the profile
|
||||
//! Profile along the spine Spine.
|
||||
@@ -88,7 +89,7 @@ public:
|
||||
//! axis passing along the vertex and the normal to the
|
||||
//! plane of the spine. At present, this is the only
|
||||
//! construction type implemented.
|
||||
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Face& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean AxeProf = Standard_True, const Standard_Boolean Solid = Standard_False, const Standard_Boolean ProfOnSpine = Standard_False, const Standard_Real Tol = 0.0000001);
|
||||
Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Face& Spine, const TopoDS_Wire& Profil, const GeomAbs_JoinType Join/* = GeomAbs_Arc*/, const Standard_Boolean AxeProf/* = Standard_True*/, const Standard_Boolean Solid/* = Standard_False*/, const Standard_Boolean ProfOnSpine/* = Standard_False*/, const Standard_Boolean theIsVolume, const Standard_Real Tol/* = Precision::Confusion()*/);
|
||||
|
||||
Standard_EXPORT const BRepFill_Evolved& Evolved() const;
|
||||
|
||||
@@ -118,9 +119,8 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRepFill_Evolved myEvolved;
|
||||
|
||||
BRepFill_Voluved myVolume;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -33,8 +33,6 @@
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spine)
|
||||
|
||||
|
||||
{
|
||||
myPipe = new (BRepFill_PipeShell) (Spine);
|
||||
SetTolerance();
|
||||
@@ -255,7 +253,7 @@ void BRepOffsetAPI_MakePipeShell::SetMaxSegments(const Standard_Integer NewMaxSe
|
||||
//function :Build()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepOffsetAPI_MakePipeShell::Build()
|
||||
void BRepOffsetAPI_MakePipeShell::Build()
|
||||
{
|
||||
Standard_Boolean Ok;
|
||||
Ok = myPipe->Build();
|
||||
|
@@ -211,7 +211,7 @@ public:
|
||||
//! discontinuities are treated like round
|
||||
//! corner. The corner is treated as rotation
|
||||
//! of the profile around an axis which
|
||||
//! passes through the point of the spine?s
|
||||
//! passes through the point of the spine's
|
||||
//! fracture. This axis is based on cross
|
||||
//! product of directions tangent to the
|
||||
//! adjacent segments of the spine at their common point.
|
||||
@@ -276,7 +276,6 @@ private:
|
||||
|
||||
Handle(BRepFill_PipeShell) myPipe;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1091,16 +1091,12 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{
|
||||
case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
Standard_FALLTHROUGH
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
Standard_FALLTHROUGH
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
Standard_FALLTHROUGH
|
||||
case 4 : break;
|
||||
default : return 1;
|
||||
}
|
||||
{ case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
|
||||
@@ -1220,14 +1216,12 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
Standard_FALLTHROUGH
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
Standard_FALLTHROUGH
|
||||
case 4 : break;
|
||||
default : return 1;
|
||||
}
|
||||
{ case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
|
||||
Standard_Boolean isconti = Standard_True;
|
||||
@@ -1343,20 +1337,15 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{
|
||||
case 9 : maxlen = Draw::Atof(a[8]);
|
||||
Standard_FALLTHROUGH
|
||||
case 8 : percent = Draw::Atof(a[7]);
|
||||
Standard_FALLTHROUGH
|
||||
case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
Standard_FALLTHROUGH
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
Standard_FALLTHROUGH
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
Standard_FALLTHROUGH
|
||||
case 4 : break;
|
||||
default : return 1;
|
||||
}
|
||||
{
|
||||
case 9 : maxlen = Draw::Atof(a[8]);
|
||||
case 8 : percent = Draw::Atof(a[7]);
|
||||
case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
|
||||
|
@@ -237,33 +237,84 @@ Standard_Integer evolved(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
|
||||
if ( n < 4 ) return 1;
|
||||
Standard_Boolean IsAFace = Standard_False;
|
||||
Standard_Boolean Solid = (!strcmp(a[0],"evolvedsolid"));
|
||||
Standard_Boolean Solid = Standard_False;
|
||||
Standard_Boolean isVolume = Standard_False;
|
||||
Standard_Boolean hasToComputeAxes = Standard_False;
|
||||
Standard_Real aTolerance = 0.0;
|
||||
TopoDS_Shape Base;
|
||||
TopoDS_Wire Prof;
|
||||
|
||||
for (Standard_Integer i = 2; i < n; i++)
|
||||
{
|
||||
if (a[i][0] != '-')
|
||||
{
|
||||
di << "Error: wrong option!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!Solid && !strcmp(a[i], "-solid"))
|
||||
{
|
||||
Solid = Standard_True;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (a[i][1])
|
||||
{
|
||||
case 's':
|
||||
{
|
||||
Base = DBRep::Get(a[++i], TopAbs_WIRE, Standard_False);
|
||||
if (Base.IsNull())
|
||||
{
|
||||
Base = DBRep::Get(a[i], TopAbs_FACE, Standard_False);
|
||||
IsAFace = Standard_True;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
{
|
||||
Prof = TopoDS::Wire(DBRep::Get(a[++i], TopAbs_WIRE, Standard_False));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
{
|
||||
isVolume = Standard_True;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
{
|
||||
hasToComputeAxes = Standard_True;
|
||||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
{
|
||||
aTolerance = Draw::Atof(a[++i]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
di << "Error: Unknown option!\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TopoDS_Shape Base = DBRep::Get(a[2],TopAbs_WIRE,Standard_False);
|
||||
if ( Base.IsNull()) {
|
||||
Base = DBRep::Get(a[2],TopAbs_FACE,Standard_False);
|
||||
IsAFace = Standard_True;
|
||||
if (Base.IsNull() || Prof.IsNull())
|
||||
{
|
||||
di << "Error: Null-shapes are not allowed\n";
|
||||
return 1;
|
||||
}
|
||||
if ( Base.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape InpuTShape(DBRep::Get(a[3],TopAbs_WIRE,Standard_False));
|
||||
TopoDS_Wire Prof = TopoDS::Wire(InpuTShape);
|
||||
// TopoDS_Wire Prof =
|
||||
// TopoDS::Wire(DBRep::Get(a[3],TopAbs_WIRE,Standard_False));
|
||||
if ( Prof.IsNull()) return 1;
|
||||
TopoDS_Shape Volevo = IsAFace ? BRepOffsetAPI_MakeEvolved(TopoDS::Face(Base),
|
||||
Prof, GeomAbs_Arc, !hasToComputeAxes,
|
||||
Solid, Standard_False, isVolume, aTolerance) :
|
||||
BRepOffsetAPI_MakeEvolved(TopoDS::Wire(Base),
|
||||
Prof, GeomAbs_Arc, !hasToComputeAxes,
|
||||
Solid, Standard_False, isVolume, aTolerance);
|
||||
|
||||
if (IsAFace) {
|
||||
TopoDS_Shape Volevo
|
||||
= BRepOffsetAPI_MakeEvolved(TopoDS::Face(Base),Prof,GeomAbs_Arc,n == 4,Solid);
|
||||
DBRep::Set(a[1],Volevo);
|
||||
}
|
||||
else {
|
||||
TopoDS_Shape Volevo
|
||||
= BRepOffsetAPI_MakeEvolved(TopoDS::Wire(Base),Prof,GeomAbs_Arc,n == 4,Solid);
|
||||
DBRep::Set(a[1],Volevo);
|
||||
}
|
||||
DBRep::Set(a[1],Volevo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -785,7 +836,11 @@ static Standard_Integer buildsweep(Draw_Interpretor& di,
|
||||
Sweep->SetTransitionMode(Transition);
|
||||
}
|
||||
// Reading solid ?
|
||||
if ((n>cur) && (!strcmp(a[cur],"-S")) ) mksolid = Standard_True;
|
||||
if ((n > cur) && (!strcmp(a[cur], "-S")))
|
||||
{
|
||||
mksolid = Standard_True;
|
||||
++cur;
|
||||
}
|
||||
|
||||
// Calcul le resultat
|
||||
Sweep->Build();
|
||||
@@ -979,10 +1034,6 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
|
||||
"evolved , no args to get help",
|
||||
__FILE__,evolved,g);
|
||||
|
||||
theCommands.Add("evolvedsolid",
|
||||
"evolved , no args to get help",
|
||||
__FILE__,evolved,g);
|
||||
|
||||
theCommands.Add("pruled",
|
||||
"pruled result Edge1/Wire1 Edge2/Wire2",
|
||||
__FILE__,pruled,g);
|
||||
|
@@ -789,8 +789,7 @@ Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
|
||||
{
|
||||
ofstream os;
|
||||
OSD_OpenStream(os, File, ios::out);
|
||||
if (!os.is_open() || !os.good())
|
||||
return Standard_False;
|
||||
if (!os.rdbuf()->is_open()) return Standard_False;
|
||||
|
||||
Standard_Boolean isGood = (os.good() && !os.eof());
|
||||
if(!isGood)
|
||||
@@ -875,21 +874,6 @@ void BRepTools::Clean(const TopoDS_Shape& theShape)
|
||||
|
||||
aBuilder.UpdateFace(aFace, aNullTriangulation);
|
||||
}
|
||||
|
||||
// Iterate over all edges seeking for 3d polygons
|
||||
Handle (Poly_Polygon3D) aNullPoly3d;
|
||||
TopExp_Explorer aEdgeIt (theShape, TopAbs_EDGE);
|
||||
for (; aEdgeIt.More (); aEdgeIt.Next ())
|
||||
{
|
||||
const TopoDS_Edge& aEdge = TopoDS::Edge (aEdgeIt.Current ());
|
||||
|
||||
TopLoc_Location aLoc;
|
||||
Handle (Poly_Polygon3D) aPoly3d = BRep_Tool::Polygon3D (aEdge, aLoc);
|
||||
if (aPoly3d.IsNull ())
|
||||
continue;
|
||||
|
||||
aBuilder.UpdateEdge (aEdge, aNullPoly3d);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -598,13 +598,6 @@ const TopoDS_Edge& BRepTools_WireExplorer::Current()const
|
||||
//=======================================================================
|
||||
TopAbs_Orientation BRepTools_WireExplorer::Orientation() const
|
||||
{
|
||||
if (myVertex.IsNull()
|
||||
&& !myEdge.IsNull())
|
||||
{
|
||||
// infinite edge
|
||||
return TopAbs_FORWARD;
|
||||
}
|
||||
|
||||
TopoDS_Iterator it(myEdge,Standard_False);
|
||||
while (it.More()) {
|
||||
if (myVertex.IsSame(it.Value()))
|
||||
|
@@ -215,21 +215,21 @@ BVH_Tree<T, N, BVH_QuadTree>* BVH_Tree<T, N, BVH_BinaryTree>::CollapseToQuadTree
|
||||
{
|
||||
const std::pair<int, int> aNode = aQueue.front();
|
||||
|
||||
BVH::Array<T, N>::Append (aQBVH->myMinPointBuffer, BVH::Array<T, N>::Value (this->myMinPointBuffer, opencascade::std::get<0> (aNode)));
|
||||
BVH::Array<T, N>::Append (aQBVH->myMaxPointBuffer, BVH::Array<T, N>::Value (this->myMaxPointBuffer, opencascade::std::get<0> (aNode)));
|
||||
BVH::Array<T, N>::Append (aQBVH->myMinPointBuffer, BVH::Array<T, N>::Value (this->myMinPointBuffer, std::get<0> (aNode)));
|
||||
BVH::Array<T, N>::Append (aQBVH->myMaxPointBuffer, BVH::Array<T, N>::Value (this->myMaxPointBuffer, std::get<0> (aNode)));
|
||||
|
||||
BVH_Vec4i aNodeInfo;
|
||||
if (this->IsOuter (opencascade::std::get<0> (aNode))) // is leaf node
|
||||
if (this->IsOuter (std::get<0> (aNode))) // is leaf node
|
||||
{
|
||||
aNodeInfo = BVH_Vec4i (1 /* leaf flag */,
|
||||
this->BegPrimitive (opencascade::std::get<0> (aNode)), this->EndPrimitive (opencascade::std::get<0> (aNode)), opencascade::std::get<1> (aNode) /* level */);
|
||||
this->BegPrimitive (std::get<0> (aNode)), this->EndPrimitive (std::get<0> (aNode)), std::get<1> (aNode) /* level */);
|
||||
}
|
||||
else
|
||||
{
|
||||
NCollection_Vector<int> aGrandChildNodes;
|
||||
|
||||
const int aLftChild = Child<0> (opencascade::std::get<0> (aNode));
|
||||
const int aRghChild = Child<1> (opencascade::std::get<0> (aNode));
|
||||
const int aLftChild = Child<0> (std::get<0> (aNode));
|
||||
const int aRghChild = Child<1> (std::get<0> (aNode));
|
||||
if (this->IsOuter (aLftChild)) // is leaf node
|
||||
{
|
||||
aGrandChildNodes.Append (aLftChild);
|
||||
@@ -252,13 +252,13 @@ BVH_Tree<T, N, BVH_QuadTree>* BVH_Tree<T, N, BVH_BinaryTree>::CollapseToQuadTree
|
||||
|
||||
for (int aNodeIdx = 0; aNodeIdx < aGrandChildNodes.Size(); ++aNodeIdx)
|
||||
{
|
||||
aQueue.push_back (std::make_pair (aGrandChildNodes (aNodeIdx), opencascade::std::get<1> (aNode) + 1));
|
||||
aQueue.push_back (std::make_pair (aGrandChildNodes (aNodeIdx), std::get<1> (aNode) + 1));
|
||||
}
|
||||
|
||||
aNodeInfo = BVH_Vec4i (0 /* inner flag */,
|
||||
aNbNodes, aGrandChildNodes.Size() - 1, opencascade::std::get<1> (aNode) /* level */);
|
||||
aNbNodes, aGrandChildNodes.Size() - 1, std::get<1> (aNode) /* level */);
|
||||
|
||||
aQBVH->myDepth = Max (aQBVH->myDepth, opencascade::std::get<1> (aNode) + 1);
|
||||
aQBVH->myDepth = Max (aQBVH->myDepth, std::get<1> (aNode) + 1);
|
||||
|
||||
aNbNodes += aGrandChildNodes.Size();
|
||||
}
|
||||
|
@@ -247,14 +247,7 @@ namespace BVH
|
||||
if (Size (theArray) == theCount)
|
||||
{
|
||||
#ifdef _STD_VECTOR_SHRINK
|
||||
|
||||
#if(defined(_MSC_VER) && (_MSC_VER < 1600))
|
||||
BVH_ArrayNt aTmpArray(theArray);
|
||||
theArray.swap(aTmpArray);
|
||||
#else
|
||||
theArray.shrink_to_fit();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@@ -222,7 +222,6 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
||||
|
||||
// 2a. Retrieve data from the stream:
|
||||
myRelocTable.Clear();
|
||||
myRelocTable.SetHeaderData(aHeaderData);
|
||||
mySections.Clear();
|
||||
myPAtt.Init();
|
||||
Handle(TDF_Data) aData = new TDF_Data();
|
||||
@@ -249,7 +248,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
||||
for (; anIterS.More(); anIterS.Next()) {
|
||||
BinLDrivers_DocumentSection& aCurSection = anIterS.ChangeValue();
|
||||
if (aCurSection.IsPostRead() == Standard_False) {
|
||||
theIStream.seekg ((std::streamsize)aCurSection.Offset());
|
||||
theIStream.seekg ((streampos) aCurSection.Offset());
|
||||
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
|
||||
ReadShapeSection (aCurSection, theIStream);
|
||||
else
|
||||
@@ -321,7 +320,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
||||
for (; aSectIter.More(); aSectIter.Next()) {
|
||||
BinLDrivers_DocumentSection& aCurSection = aSectIter.ChangeValue();
|
||||
if (aCurSection.IsPostRead()) {
|
||||
theIStream.seekg ((std::streamsize)aCurSection.Offset());
|
||||
theIStream.seekg ((streampos) aCurSection.Offset());
|
||||
ReadSection (aCurSection, theDoc, theIStream);
|
||||
}
|
||||
}
|
||||
@@ -532,3 +531,4 @@ Standard_Boolean BinLDrivers_DocumentRetrievalDriver::CheckDocumentVersion(
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -160,7 +160,7 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream,
|
||||
const uint64_t theOffset)
|
||||
{
|
||||
const uint64_t aSectionEnd = (uint64_t) theStream.tellp();
|
||||
theStream.seekp((std::streamsize)myValue[0]);
|
||||
theStream.seekp(myValue[0]);
|
||||
myValue[0] = theOffset;
|
||||
myValue[1] = aSectionEnd - theOffset;
|
||||
uint64_t aVal[3] = {
|
||||
@@ -175,7 +175,7 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream,
|
||||
#endif
|
||||
|
||||
theStream.write((char *)&aVal[0], 3*sizeof(uint64_t));
|
||||
theStream.seekp((std::streamsize)aSectionEnd);
|
||||
theStream.seekp(aSectionEnd);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -429,11 +429,6 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
|
||||
Standard_Integer aObjNb = 1;
|
||||
Standard_Integer aShemaVer = 1;
|
||||
|
||||
// Store the name and version of the application that has created the
|
||||
// document.
|
||||
theData->SetApplicationVersion(theDoc->Application()->Version());
|
||||
theData->SetApplicationName(theDoc->Application()->Name());
|
||||
|
||||
aHeader.einfo += FSD_BinaryFile::WriteInfo (theOStream,
|
||||
aObjNb,
|
||||
BinLDrivers::StorageVersion(),
|
||||
|
@@ -1,49 +0,0 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Benjamin BIHLER
|
||||
// Copyright (c) 2017 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BinObjMgt_RRelocationTable.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetHeaderData
|
||||
//purpose : getter for the file header data
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Storage_HeaderData)& BinObjMgt_RRelocationTable::GetHeaderData() const
|
||||
{
|
||||
return myHeaderData;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetHeaderData
|
||||
//purpose : setter for the file header data
|
||||
//=======================================================================
|
||||
|
||||
void BinObjMgt_RRelocationTable::SetHeaderData(
|
||||
const Handle(Storage_HeaderData)& theHeaderData)
|
||||
{
|
||||
myHeaderData = theHeaderData;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose : The relocation table is cleared before/after reading in a document.
|
||||
// : In this case the reference to the file header data should also be
|
||||
// : cleared, because it is specific to the document.
|
||||
//=======================================================================
|
||||
void BinObjMgt_RRelocationTable::Clear(const Standard_Boolean doReleaseMemory)
|
||||
{
|
||||
myHeaderData.Nullify();
|
||||
TColStd_DataMapOfIntegerTransient::Clear(doReleaseMemory);
|
||||
}
|
@@ -17,36 +17,8 @@
|
||||
#define _BinObjMgt_RRelocationTable_HeaderFile
|
||||
|
||||
#include <TColStd_DataMapOfIntegerTransient.hxx>
|
||||
#include <Storage_HeaderData.hxx>
|
||||
|
||||
//! Retrieval relocation table is modeled as a child class of
|
||||
//! TColStd_DataMapOfIntegerTransient that stores a handle to the file
|
||||
//! header section. With that attribute drivers have access to the file header
|
||||
//! section.
|
||||
class BinObjMgt_RRelocationTable : public TColStd_DataMapOfIntegerTransient
|
||||
{
|
||||
public:
|
||||
typedef TColStd_DataMapOfIntegerTransient BinObjMgt_RRelocationTable;
|
||||
|
||||
//! Returns a handle to the header data of the file that is begin read
|
||||
Standard_EXPORT const Handle(Storage_HeaderData)& GetHeaderData() const;
|
||||
|
||||
//! Sets the storage header data.
|
||||
//!
|
||||
//! @param theHeaderData header data of the file that is begin read
|
||||
Standard_EXPORT void SetHeaderData(
|
||||
const Handle(Storage_HeaderData)& theHeaderData);
|
||||
|
||||
Standard_EXPORT void Clear(const Standard_Boolean doReleaseMemory = Standard_True);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Handle(Storage_HeaderData) myHeaderData;
|
||||
};
|
||||
|
||||
#endif // _BinObjMgt_RRelocationTable_HeaderFile
|
||||
|
@@ -7,6 +7,5 @@ BinObjMgt_PExtChar.hxx
|
||||
BinObjMgt_PInteger.hxx
|
||||
BinObjMgt_PReal.hxx
|
||||
BinObjMgt_PShortReal.hxx
|
||||
BinObjMgt_RRelocationTable.cxx
|
||||
BinObjMgt_RRelocationTable.hxx
|
||||
BinObjMgt_SRelocationTable.hxx
|
||||
|
@@ -137,85 +137,71 @@ namespace
|
||||
addPoint1;
|
||||
if (aFin <= 1) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 2:
|
||||
{
|
||||
addPoint2;
|
||||
if (aFin <= 2) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 3:
|
||||
{
|
||||
addPoint3;
|
||||
if (aFin <= 3) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 4:
|
||||
{
|
||||
addPoint4;
|
||||
if (aFin <= 4) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 5:
|
||||
{
|
||||
addPoint5;
|
||||
if (aFin <= 5) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 6:
|
||||
{
|
||||
addPoint6;
|
||||
if (aFin <= 6) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 7:
|
||||
{
|
||||
addPoint7;
|
||||
if (aFin <= 7) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 8:
|
||||
{
|
||||
addPoint0;
|
||||
if (aFin <= 8) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 9:
|
||||
{
|
||||
addPoint1;
|
||||
if (aFin <= 9) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 10:
|
||||
{
|
||||
addPoint2;
|
||||
if (aFin <= 10) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 11:
|
||||
{
|
||||
addPoint3;
|
||||
if (aFin <= 11) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 12:
|
||||
{
|
||||
addPoint4;
|
||||
if (aFin <= 12) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 13:
|
||||
{
|
||||
addPoint5;
|
||||
if (aFin <= 13) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 14:
|
||||
{
|
||||
addPoint6;
|
||||
if (aFin <= 14) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 15:
|
||||
{
|
||||
addPoint7;
|
||||
@@ -1285,49 +1271,41 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
|
||||
addP0;
|
||||
if (Fi2 <= 0) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 1 :
|
||||
{
|
||||
addP1;
|
||||
if (Fi2 <= 1) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 2 :
|
||||
{
|
||||
addP2;
|
||||
if (Fi2 <= 2) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 3 :
|
||||
{
|
||||
addP3;
|
||||
if (Fi2 <= 3) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 4 :
|
||||
{
|
||||
addP4;
|
||||
if (Fi2 <= 4) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 5 :
|
||||
{
|
||||
addP5;
|
||||
if (Fi2 <= 5) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 6 :
|
||||
{
|
||||
addP6;
|
||||
if (Fi2 <= 6) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 7 :
|
||||
{
|
||||
addP7;
|
||||
if (Fi2 <= 7) break;
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case 8 :
|
||||
default :
|
||||
{
|
||||
@@ -1335,25 +1313,18 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
|
||||
switch (Fi2) {
|
||||
case 15 :
|
||||
addP7;
|
||||
Standard_FALLTHROUGH
|
||||
case 14 :
|
||||
addP6;
|
||||
Standard_FALLTHROUGH
|
||||
case 13 :
|
||||
addP5;
|
||||
Standard_FALLTHROUGH
|
||||
case 12 :
|
||||
addP4;
|
||||
Standard_FALLTHROUGH
|
||||
case 11 :
|
||||
addP3;
|
||||
Standard_FALLTHROUGH
|
||||
case 10 :
|
||||
addP2;
|
||||
Standard_FALLTHROUGH
|
||||
case 9 :
|
||||
addP1;
|
||||
Standard_FALLTHROUGH
|
||||
case 8 :
|
||||
break;
|
||||
}
|
||||
|
@@ -460,7 +460,6 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
|
||||
break;
|
||||
}
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
default:
|
||||
{
|
||||
Standard_Integer Nu = NbUSamples(S);
|
||||
|
@@ -103,25 +103,3 @@ void CDM_Application::EndOfUpdate
|
||||
message+=aDocument->Presentation();
|
||||
Write(message.ToExtString());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose : returns the application name
|
||||
//=======================================================================
|
||||
|
||||
TCollection_ExtendedString CDM_Application::Name() const
|
||||
{
|
||||
// Default: empty
|
||||
return TCollection_ExtendedString();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Version
|
||||
//purpose : returns the application version
|
||||
//=======================================================================
|
||||
|
||||
TCollection_AsciiString CDM_Application::Version() const
|
||||
{
|
||||
// Default: empty
|
||||
return TCollection_AsciiString();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user