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

Compare commits

...

144 Commits

Author SHA1 Message Date
abv
af6b493fc9 Change version from "6.9.1.dev" to "6.9.1.beta" 2015-09-02 14:39:58 +03:00
abv
409de561cd 0026245: Unable to write SAT file by default
XSAlgo_AlgoContainer is corrected to return original shape if Shape Processing fails.
Handling of situation of absence of defined operator sequence is corrected to apply DirectFaces operator by default on writing, regardless of target format.
ShapeProcess is corrected to output warning if operator sequence is not defined in resource file, and to continue if one operator in sequence has failed.
Message names are made more meaningful.
2015-09-02 14:39:57 +03:00
emv
f435c40bc8 0026019: Unstable behavior of test cases with operation mkvolume
The maps have been replaced with indexed maps to provide stability
of the algorithms based on the General Fuse algorithm.
2015-09-02 14:39:56 +03:00
kgv
0b94a4f33d 0026611: Visualization, TKService - fix NULL-dereference in Font_FontMgr on broken font
Check FT_Face::family_name for NULL during detection.
Skip fonts without mandatory UNICODE charset in Font_FontMgr.
2015-09-02 14:39:54 +03:00
kgv
4ce07e4ec6 0026613: Coding - avoid use of macros in Resource_Manager.cxx
Replace macros by enum Resource_KindOfLine.
2015-09-02 14:39:53 +03:00
nbv
23ea021260 0026310: Very slow boolean cut operations on cylinders
1. JoinWLines algorithm has been improved.
2. Reference to the V-boundaries is deleted when computing step.
3. Decreasing the tolerance when computing parameters of WLine.
4. Adding boundary point is forbidden if it lies in prolongation of found ones.
5. Possible reason of exception has been eliminated.
6. Processing of critical point has been improved.

Test cases for this issue have been created.
Correction of some test case(s).

Test case bugs/modalg_6/bug26310_4 is added

Update of test-cases for issue #26310
2015-09-02 14:39:52 +03:00
ika
d18c866246 0026241: Sewing algorithm computes tolerance of joint vertex too rough
Upgrade method of computing vertex tolerance.
Update function, which used the old method.
Test case for issue CR26241
Delete obsolete variables.
2015-09-02 14:39:51 +03:00
abv
f206b65145 Revert previously made adjustment of test cases for Linux
- boolean volumemaker C1: the problems disappeared on Windows are still present on Linux
- boolean volumemaker F8: improvement on Linux found on master due to #24682 does not happen in OCCT 6.9.1, since #24682 is not included
2015-09-02 14:39:50 +03:00
aml
da871fb5c9 0026605: Possible array out of bounds read in Extrema_GExtPC.gxx
Degenerated case fixed.
2015-09-02 14:39:49 +03:00
gka
1c9e5ae0f1 0026376: Imported STEP shape is partially wrong
Modification of the translation of the face based on the toroidal surface with negative major radius was made.
Seems that such face is considered by "Solid Works" and "ProE wildfire 5.0" systems as face having reversed orientation.
This step file was written by "Solid Works 2014".
2015-09-02 14:39:30 +03:00
ika
e84806af3b 0026461: STEP Import interface crashes
Add a check for NULL;
some code refactoring.
2015-09-02 14:39:29 +03:00
Roman Lygin
4ae88e723d 0026574: Remove redundant dependence of TKIGES on TKOffset 2015-09-02 14:39:27 +03:00
abv
134735be7b Adjustment of test cases
- bugs modalg_6 bug26238: check real values with tolerance to avoid false failures due to numeric deviations
- draft angle G8: removed TODOs that do not exhibit in 6.9.1 branch
- boolean gdml_private O1: unstable
2015-09-02 14:39:26 +03:00
aml
b01be5abf8 0026440: Invalid shape as a result of solid construction in BRepOffset_MakeOffset
Fixed degeneration in wall building in thicksolid mode.
2015-09-02 14:39:25 +03:00
aml
574ea6faba 0026556: Infinite calculations of BRepOffset_MakeOffset
Method for pre-analysis of input data added (CheckInputData).
Now it is possible to work with Error() function, which return error code.

Tests corrected according to changed error appearance.
2015-09-02 14:39:24 +03:00
azv
a2361eda86 0026458: BRepBuilderAPI_Copy does not copy mesh structure
The possibility to preserve triangulation in the copied shape is implemented.
It may be enabled by copyMesh flag, by default it is disabled.
Depending on copyGeom flag, the triangulation is shared with original shape (if False) or copied (if True).

Poly_Triangulation::Copy() method is added.
2015-09-02 14:39:23 +03:00
apn
d0af00dc66 0026447: Performance degradation intersecting cylindrical surfaces
Added test case bugs/modalg_6/bug26447
2015-09-02 14:39:22 +03:00
aml
e965d0c73c 0025981: Wrong result obtained by projection algorithm.
Adjust periodic added.

processing of V parameter periodicity added.

Test case for issue CR25981
2015-09-02 14:39:21 +03:00
nbv
17e64c3080 0025820: No Intersection Curves between surface of revolution and planes
Thin shapes processing has been improved.

Test-cases for issue #25820

Comment has been changed
2015-09-02 14:39:20 +03:00
mkv
fec4763816 Add test case for #26446 2015-09-02 14:39:19 +03:00
gka
3884c1d394 0026289: STEP import/export produces an empty shape
Exception is raised during reading step file containing p-curve having not-unique last knot.
Modification correcting misprint during computation new numbers of poles for such case was made in the file StepToGeom_MakeBSplineCurve.pxx
Protection against exception was made in the file StepToTopoDS/StepToTopoDS_TranslateEdge.cxx.
Warning message was added in the file StepToTopoDS_TranslateEdgeLoop.cxx.

Test case for issue CR26289
2015-09-02 14:39:18 +03:00
dbv
52ee6a456b 0026553: Out of range exception in BRepFill_Pipe::FindEdge
Test case for issue CR26553
Warning fix
2015-09-02 14:39:17 +03:00
jgv
1c6adc4f1e 0026554: Error in IntPatch_PrmPrmIntersection: initial step for walking line is not related with actual tolerance
Test case for issue CR26554
Small corrections for issue CR26554
2015-09-02 14:39:15 +03:00
abv
e297ccbaa1 0025775: "Default Gradient Backgound" in V3d_Viewer has no effect in new created V3d_View.
Complete the fix: add gradient background in second variant of V3d_View::SetWindow()
2015-09-02 14:39:14 +03:00
abv
e09a591f48 Adjustment of tests for OCCT 6.9.1:
- de iges_1 L8,P7 - corrected according to changes made in #24682, with minor amendment of number of labels
- heal wire_tails_real A5 - corrected as in master
- offset wire_unclosed_outside_0_025 B4 - correcting according to actual state (looks better)
- de step_3 F1 - corrected according to actual state, see #26597
- de iges_1 N9 - reverted to state before integration of #25593 (zero-area face is created due to self-intersecting wire)
2015-09-02 14:39:13 +03:00
abv
cc19ba1caf Adjusting testing case 2015-09-02 14:39:12 +03:00
abv
11fd45038f 0026403: Lack of Standard_EXPORT keyword in SelectMgr headers
Some Standard_EXPORT keywords added to be able to link with TKV3d
2015-09-02 14:39:11 +03:00
kgv
41d16f029b 0026547: Configuration - fix compilation errors on VS2015
Interface_STAT.cxx - rename local variable 'stat' to 'myStat' to avoid name collision.
OSD_FileNode.cxx - pass correct argument to va_start().
STEPConstruct_AP203Context::DefaultDateAndTime() - use _get_timezone() instead of global variable timezone on msvc.
Graphic3d_ArrayOfPrimitives::VertexColor() - fix reinterpret_cast() argument.

Small correction: OCC26481-linesarc.brep is equal to bug26296_linesarc.brep
2015-09-02 14:39:10 +03:00
jgv
8b04c979b2 0026540: Errors in BRepOffsetAPI_MakeOffset: infinite loop in method FixHoles for closed results.
Test case for issue CR26540
2015-09-02 14:39:09 +03:00
ysn
7c2cc7228d Sign added and some formatting changes 2015-09-02 14:39:08 +03:00
pkv
eb20feb3bc 0026243: Boolean operations failed on shapes with fillets
Detected bugs have been fixed.

Test case for issue CR26243
2015-09-02 14:38:50 +03:00
mkv
dd531ee973 0026442: Access violation in BRepOffset_MakeOffset
Test cases for issue CR26442
2015-09-02 14:38:49 +03:00
apv
ec356f5273 0024522: Application crashes on view closing in case of using of clipping planes
Test-case for issue #24522
2015-09-02 14:38:48 +03:00
vpa
1ba2234442 0026249: Visualization, TKV3d - fix possible division by zero in SelectMgr_RectangularFrustum
Added zero-length check for triangle normal in SelectMgr_RectangularFrustum::Overlaps
2015-09-02 14:38:47 +03:00
oan
08c65c2355 0026485: Problem with the normals of a triangulated shape
Use gp::Resolution() instead of Precision::SquareConfustion() in order to normalize normal vectors according to implementation of gp_Vec::Normalize().

Test case

Test-case for issue #26485
2015-09-02 14:38:46 +03:00
apv
86fc2729b8 0026496: Error in use the BRepCheck_Analyzer
Test-case for issue #26496
2015-09-02 14:38:45 +03:00
abelcsik
73bc951212 0026385: Fix to prevent BRepMesh from possible crash due to pointer to local variable stored inside Extrema_LocateExtPC
Made the BRepAdaptor_Curve a member of BRepMesh_EdgeParameterProvider to ensure that it is created before and destroyed after the Extrema_LocateExtPC that uses it.
2015-09-02 14:38:43 +03:00
aml
5d59062054 026464: BRepOffset_MakeOffset does not provide valid output
Handling of degenerated case improved.

Test-case for issue #26464
2015-09-02 14:38:42 +03:00
jgv
c93109fe43 0026481: Incorrect result of BRepOffsetAPI_MakeOffset: excess hanging arcs in the open result with join type GeomAbs_Arc
Test-case for issue #26481
2015-09-02 14:38:41 +03:00
pkv
1ecda52ad7 0026483: Option Run Parallel is not used by the command bopargcheck
I. New features:
No new features

II. Changes:
II.1 class BOPTest
-static function:
Standard_Integer bopargcheck (Draw_Interpretor& di,
                              Standard_Integer n,
                              const char** a )
The option has been retrieved and passed to the checker algorithm.

III. Modified entities:
packages:
BOPTest
2015-09-02 14:38:40 +03:00
nbv
c19a07bc44 0026484: BRepExtrema_DistShapeShape hangs
Check in math_GlobOptMin::computeGlobalExtremum(...) method if the parameter went out of boundary(-ies).

Added test case bugs/modalg_6/bug26484
2015-09-02 14:38:39 +03:00
aml
a2e99c91fa 0026473: Offset API fails to create offset shape
Tolerance of map building changed.
Added possibility to work 0.0 offset value.

Added test cases bugs/modalg_6/bug26473_1 bug26473_2
2015-09-02 14:38:38 +03:00
emv
f85265c252 0026420: BOPAlgo_Builder resets "Closed" flag in the result
Set flag Closed to new Wires and Shells created in General Fuse algorithm if necessary.

Test-cases for issue #26420
2015-09-02 14:38:37 +03:00
emv
9926d83075 0026444: Boolean operation "bcut" gives invalid result between solid and halfspace solid.
class BOPAlgo_PaveFiller
method void BOPAlgo_PaveFiller::PutPaveOnCurve
  (const Standard_Integer nV,
   const Standard_Real aTolR3D,
   BOPDS_Curve& aNC,
   const BOPCol_MapOfInteger& aMI,
   BOPCol_DataMapOfIntegerReal& aMVTol,
   const Standard_Integer iCheckExtend)

Do not put the pave on the curve in case if there is already one with the same parameter.
Update tolerance of the existing vertex to reach the new one.

Added test case bugs/modalg_6/bug26444.
Test boolean/volumemaker/G1 is stable now (deleted TODOs), test offset/faces_type_i/C9 is bad (offset is done with wrong result).
2015-09-02 14:38:36 +03:00
duv
9b22664c02 0026492: OpenGl_FrameBuffer does not releases itself correctly
Logic related to myIsOwnBuffer flag in OpenGl_FrameBuffer was corrected.
2015-09-02 14:38:35 +03:00
kgv
e646e2af68 0026476: Visualization, TKOpenGl - do not enable GL_NORMALIZE in core profile 2015-09-02 14:38:34 +03:00
kgv
c57360a7ce 0026479: Visualization, TKOpenGl - do not implicitly turn off stereo in OpenGl_Workspace::RedrawImmediate() 2015-09-02 14:38:32 +03:00
apl
d3fab23ba9 0025775: "Default Gradient Background" in V3d_Viewer has no effect in new created V3d_View. 2015-09-02 14:38:31 +03:00
vpa
c6a60baab7 0026430: Visualization - segmentation fault in opened local context
- check for empty dataset in Select3D_SensitiveSet was added;
- test case for issue #26430
2015-09-02 14:38:30 +03:00
apl
c633105394 0026401: Visualization - small boxes in front of big one disappear in perspective view 2015-09-02 14:38:29 +03:00
isn
9780f0e177 0026466: UnifySameDomain creates invalid result shape from valid input shape
Test-case for issue #26466
2015-09-02 14:38:28 +03:00
emv
58c3e0dcd4 0026393: Add draw commands to evaluate history of modifications of BOP
DRAW commands bmodified, bisdeleted, bgenerated have been implemented to track
the history of shapes modifications in Boolean and General Fuse operations.

Test-case for issue #26393
2015-09-02 14:38:27 +03:00
aml
6063352953 0026468: Out of range exception on current master
Problem with different ranges fixed.

test cases update.
2015-09-02 14:38:26 +03:00
kgv
271eca4e51 0026454: Visualization, TKOpenGl - do not require deprecated function of GL_ARB_vertex_type_2_10_10_10_rev in core profile 2015-09-02 14:38:25 +03:00
aml
06fe939893 0026446: GeomConvert::ConcatC1 produces not expected curve
Concatenation fixed.
2015-09-02 14:38:24 +03:00
aml
f6ec43465e 0026418: Unjustified limitation on tolerance of a input shape in BRepOffset_MakeOffset
Performance improvements and regression elimination.
Handling of degenerated case added.

Update of test-case offset faces_type_a A2 according to the new behavior
Test-case for issue #26418
2015-09-02 14:38:22 +03:00
gka
24bda0a60b 0026408: Exception during fixshape procedure.
Attached invalid shape is represented by solid containing one face twice.
Protection from such case was added in ShapeFix_Shell class.
Creation of COMPSOLID was modified for case when shells composing COMPSOLID have the same shared faces in order to prevent hanging.
Small modification.Protection to avoid exception
Test-case for issue #26408
2015-09-02 14:38:21 +03:00
kgv
1a8e73d756 0026424: Visualization, TKOpenGl - fix text rendering in core profile
OpenGl_Context::init() - fix condition on initializing alien OpenGL context within core profile.
OpenGl_Font::renderGlyph() - use GL_RED data format in core profile.
OpenGl_Text::render() - do not use GL_ALPHA_TEST in core profile.

Test-case for issue #26424
2015-09-02 14:38:20 +03:00
aml
a010375290 0026351: Wrong result found by the projection algorithm
C2 continuity intervals changed to Knots intervals in case of Bspline curve.
Fixed incorrect extremaPC usage.

Test case for issue CR26351
Update of test-cases according to the new behavior

Conflicts:
	tests/de/step_2/U8
2015-09-02 14:38:19 +03:00
nbv
efe826bff1 0026308: Segmentation fault in BSplCLib::LocateParameter
Detection of "jumping" knot value has been improved.
Test-case for issue #26308
Comment has been added in test case bugs/modalg_6/bug26308.
2015-09-02 14:38:18 +03:00
ifv
534beb0a8d 0026406: BRepPrimAPI_MakeRevol crash when rotating Paraboloid face.
Test-case for issue #26406
2015-09-02 14:38:17 +03:00
ifv
bc479df6c7 0026387: BRepPrimAPI_MakePrism crash when extruding Paraboloid face.
Test-cases for issue #26387
2015-09-02 14:38:16 +03:00
ifv
233b69d788 0025048: Wrong return value of GeomLib_Tool::Parameter 2015-09-02 14:38:15 +03:00
oan
2c74997d54 0026398: Tricheck command should be extended to show free nodes and links breaking mesh consistency
Remark from MSV
2015-09-02 14:38:13 +03:00
apl
91378854c3 0026369: Modeling Data - Geom_OffsetSurface direction is wrong for indirect conical surface 2015-09-02 14:38:12 +03:00
vpa
704116ecb1 0026394: Visualization - eliminate unused variable in SelectMgr_RectangularFrustum
Unnecessary calculations were removed
2015-09-02 14:38:11 +03:00
oan
76b8e79250 0026390: IntTools_Context should provide possibility to set tolerance used by PointOnSurf projector instead using of strict value 1.e-12
New method SetPOnSProjectionTolerance to set projection tolerance has been added IntTools_Context. By default it is set to 1.e-12
2015-09-02 14:38:10 +03:00
emv
d0da782fe1 0026379: Wrong result produced by the volume maker algorithm
1. class BOPAlgo_ShellSplitter
static method void RefineShell(TopoDS_Shell& theShell,
                               BOPCol_ListOfShape& aLShX)
Added protection from INTERNAL edges.

2. class BOPAlgo_MakerVolume
method void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
Creation of the overlapping box of proper size.

Test-cases for issue #26379
2015-09-02 14:38:09 +03:00
aml
067a4a33d8 0026356: Wrong result done by projection algorithm
Changed internal one dimension search algorithm in case of fast changing curve.

Test-case for issue #26356
2015-09-02 14:38:08 +03:00
nbv
9af6ab1e5c 0025613: Wrong distance found by xdistef command for attached shapes
1. Divide B-spline curve on sub-intervals (bounded by knots values).
2. Class BRepLib_CheckCurveOnSurface_TargetFunc has been optimized for future implementation to checkshape algorithm (Adaptors are used instead of Geom_Curve(Surface)).
3. Parallelization of new algorithm.

The algorithm is based on math_PSO class.

Test cases for issue 25613 have been created.

Changes in accordance with the last remarks
2015-09-02 14:38:07 +03:00
abv
f6c4ac4b8d 0026341: Uninitialized field in ShapeFix_Face
Parameter RemoveSmallAreaFaceMode in ShapeFix_Face is properly initialized; some other minor corrections
2015-09-02 14:38:06 +03:00
ink
838a9fca4b 0026342: No materials are read from STEP
Changed number of  arguments for descriptive_representation_item (for the case when description is absent).

Test case for issue CR26342
2015-09-02 14:38:05 +03:00
aml
a1b71d7f53 0026339: [Regression in 6.9.0] Projecting a curve hangs
Changed computation of point projection to more correct.
Calculation periodicity information added to cache.
Test case for issue CR26339

Small correction of test case for issue CR26339
2015-09-02 14:38:04 +03:00
jgv
f9b5dde31f 0026332: BRepOffsetAPI_ThruSections algorithm fails on two wires with different number of edges
Correction according to remark.

Correction of mistake.

Test case for issue CR26332
2015-09-02 14:38:02 +03:00
jgv
de2f4c61bf 0026296: Errors in BRepOffsetAPI_MakeOffset: failure because of wrong direction of bisector.
Test cases for issue CR26296

Fix of regressions.

Small correction of test cases for issue CR26296
2015-09-02 14:38:01 +03:00
mkv
f2d0720f0e Eliminating instability in test cases 2015-09-02 14:38:00 +03:00
isk
e5e388ac07 0023028: Visualization, TKOpenGl - eliminate global static variables
OpenGl_CappingAlgo - move global variables to OpenGl_Workspace class fields.
OpenGl_View::ShaderSource::Source() - drop static for local variable.
OpenGl_Window - drop redundant global constant THE_DEFAULT_BG_COLOR.
2015-09-02 14:37:59 +03:00
isn
4a934783ee 0026219: ShapeUpgrade_UnifySameDomain fails with StdFail_NotDone exception
Avoid merging edges if the collapsed vertex has a third connected edge.
Fix the problem when merged edges have different location.
Test case for issue CR26219

Additional fix to improve robustness.

Test cases for issue CR26219

Small correction of test cases for issue CR26219
2015-09-02 14:37:58 +03:00
ifv
e55cd82c8e 0026330: BRepOffsetAPI_ThruSections creates invalid shape
Test case for issue CR26330
2015-09-02 14:37:57 +03:00
apl
9f87ad8c86 0026357: Visualization - Panning zooms view if aspect ratio > 1 2015-09-02 14:37:56 +03:00
emv
cf4520ebc6 0026316: Infinite modification of the shapes in General Fuse operation
Check the validity of the intersection point between Faces.

Test case for issue CR26316

Correction of the test case for the issue.

Small correction of test case for issue CR26316
2015-09-02 14:37:55 +03:00
kgv
039add17a8 0026359: Revolution shape of Parabola Curve has no triangles
Adaptor3d_IsoCurve::Circle() - prevent parallel check with NULL-vector

Test case for issue CR26359
2015-09-02 14:37:54 +03:00
kgv
c1f20b28fe 0025556: Visualization - support stereo pair formats recognized by consumer display devices
Graphic3d_StereoMode - add new enumeration for stereoscopic outputs:
- Graphic3d_StereoMode_QuadBuffer
- Graphic3d_StereoMode_Anaglyph
- Graphic3d_StereoMode_RowInterlaced
- Graphic3d_StereoMode_ColumnInterlaced
- Graphic3d_StereoMode_ChessBoard
- Graphic3d_StereoMode_SideBySide
- Graphic3d_StereoMode_OverUnder

Graphic3d_RenderingParams - add new options controlling stereo output:
- StereoMode
- ToReverseStereo
- AnaglyphFilter

OpenGl_ShaderManager - add predefined GLSL programs for new stereo outputs.
OpenGl_Workspace::Redraw() - do not implicitly disable stereo to allow stereo dump as is.
OpenGl_Caps - add flag swapInterval to control VSync.
OpenGl_Workspace::BufferDump() - handle cases with non-applicable GL_PACK_ROW_LENGTH.

CALL_DEF_WINDOW - drop unused fields; add fields "left" and "top"
to reverse stereo pair for interlaced output depending on window position.

Draw Harness, ViewerTest:
- Extend syntax of command vstereo to setup stereo.
- Extend vdump command to allow dump of stereoscopic pair in different formats.
- Extend command vcaps with option vsync.
- Use mouse scroll to zoom and adjust ZFocus in WinAPI.
- Use "/" and "*" to adjust IOD.

v3d/glsl/stereo - add test case for stereo modes.

Cocoa_LocalPool, OSD_EnvironmentIterator - fix compilation issues on OS X Snow Leopard.
2015-09-02 14:37:52 +03:00
apl
5fcc7382dc 0025760: Visualization - precision factor added to ZNear, ZFar in method ZFitAll() of Graphic3d_Camera is not enough
Small correction of test cases for issue CR25760
2015-09-02 14:37:12 +03:00
ifv
b44e3bbd33 0026305: BRepFeat_MakePrism returns inconsistent results && 026315: BRepFeat_MakeRevol fails to create revol from shape
Test-cases for issues #26305 and #26315
2015-09-02 14:32:40 +03:00
vpa
bd7987d5dd 0026324: Visualization - fix iteration through corrupted memory in AIS_LocalContext::FindSelectedOwnerFromShape
The signature of SelectMgr_ViewerSelector::ActiveOwners is changed to return output parameter to avoid crash
2015-09-02 14:32:38 +03:00
nbv
06ce88fdef 0026151: Wrong result obtained by intersection algorithm.
1. Methods IntPolyh_MaillageAffinage::GetMinDeflection() and IntPolyh_MaillageAffinage::GetMaxDeflection() have been created (see cdl-file for more detail information).
2. Extended check, if starting point of WLine is a tangent point, has been implemented in IntWalk_PWalking::Perform(...) method.

Test cases for issue CR26151
2015-08-23 23:23:32 +03:00
abv
168bef440d 0026306: Access to deleted object in ShapeFix_FixSmallSolid
Code corrected to avoid accessing element of sequence by reference after it is removed.
2015-08-23 23:23:32 +03:00
abv
7e66f8d719 0026307: Minor improvements in snowflake sample
- background is set to while, and lines are black
- dimension line added
- category is corrected
2015-08-23 23:23:31 +03:00
vpa
954e19f009 0026284: Visualization - eliminate recursion in SelectMgr_SelectionManager
Small correction of test case for issue CR26284
2015-08-23 23:23:30 +03:00
msv
587c15bd7d 0026206: BRepClass_FaceClassifier returns TopAbs_OUT for internal point
Classifier has been corrected to not take into account a probing point if the probing line appears to be tangent to the boundary at this point.

But allow to use tangent point if all points on the edge are tangent.
Modify bad test cases.

Test case for issue CR26206
2015-08-23 23:23:29 +03:00
vpa
026dbb46c9 0026304: Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint 2015-08-23 23:23:28 +03:00
ifv
5050c82886 0026230: Segmentation fault because a NULL curve is used without precaution in case of a projection failure 2015-08-23 23:23:27 +03:00
nbv
3e673cffa9 0026193: Incomplete intersection curve
1. Conditions for adjusting and for breaking Walking-lines have been amended.
2. Processing of case when WLine should be broken has been changed.

Test cases for issues 26193 and 26208 have been added

Cosmetic correction of test-cases

Modification of test-case according to the new behavior.
2015-08-23 23:23:26 +03:00
nbv
ae5635ca15 0026281: BRepCheck_Edge::Tolerance() raises exception on the given shapes
The reason of the exception has been eliminated

Test-cases for issue #26281
2015-08-23 23:23:25 +03:00
ifv
edab390e05 0026233: BRepOffset_MakeOffset makes incorrect result
Test-case for issue #26233
2015-08-23 23:23:24 +03:00
omy
44d4c9e586 0026276: Visualization, TKOpenGl - add missing Standard_EXPORT to matrix management methods in OpenGl_Context
These methods are useful for applying matrices transformations.
2015-08-23 23:23:23 +03:00
omy
4b2089edec 0026275: Visualization, TKOpenGl - add public constructor for OpenGl_ShaderProgram 2015-08-23 23:23:23 +03:00
bugmaster
de7efa01cc Temporally removing several cases from boolean/gdml_private group. 2015-08-23 23:23:22 +03:00
mkv
ff70447591 Update testing cases after integration issue 26253 2015-08-23 23:23:21 +03:00
jgv
6658b677bc 0026185: BRepOffsetAPI_MakeOffset: regressions on some customer's cases
Minor correction.

Test-cases for issue #26185

Modifications in test-cases according to developer's notes
2015-08-23 23:23:20 +03:00
pkv
5719c9ecc4 0026253: Wrong result obtained by General Fuse operator.
Replace BOPCol_MapOfShape by BOPCol_IndexedMapOfShape to provide
the same order of shells in the result

Test case for issue CR26253

Correction of test case for issue CR26253
2015-08-23 23:23:19 +03:00
abk
6670aadd5d 0026261: Create a tool to remove tails from any wire
A tool to remove tails from the wires of a shape was created.
The tool is based on mechanism 'ShapeFix',
is located in types 'ShapeFix_Wire' and 'ShapeAnalysis_Wire',
is enabled through method 'ShapeFix_Wire::FixTailMode' and
is initialized by methods 'ShapeFix_Wire::SetMaxTailAngle' and 'ShapeFix_Wire::SetMaxTailWidth' and
is called through method 'ShapeFix_Wire::FixTails'.
The status of any performing of the last method is accessible through method 'ShapeFix_Wire::StatusFixTails'.
The tail angle is checked only at the tail start.

Mechanism 'ShapeFix' was modified:
- the tool is disabled by default;
- algorithm 'Fix notched edges' is disabled then the tool is enabled;
- the tool and the last algorithm work in turns then the tool works on the request.

'Draw' command 'fixshape' was extended by options '-maxtaila' and '-maxtailw' to test the tool.

'Draw' tests to test the tool were created.

Algorithm 'fixshape' was changed in type 'ShapeProcess_OperLibrary' to
- use new parameters named 'FixTailMode', 'MaxTailAngle' (in degrees) and 'MaxTailWidth' from the algorithm context;
- apply the tool after the shape will be fully fixed if the tool was enabled.

Place holders for the new parameters were created in the resource file of mechsnism 'STEPControl_Reader'.

Test cases for issue CR26261
2015-08-23 23:23:18 +03:00
abk
84c9d28189 0026259: Extend commands '{l|s|v}props' to output the values with the full precision
Additional option '-full' was added to 'Draw' commands 'lprops', 'sprops' and 'vprops'
to output the values not only with the short but and with the full precision.
2015-08-23 23:23:17 +03:00
aml
b97a779a9f 0026022: Extrema_ExtCC gives not precise solution
Conditional optimization added to Newton optimization algorithm.
Test case for issue CR26022
2015-08-23 23:23:17 +03:00
dbp
b5913c3c89 0026221: Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_Layer to improve performance 2015-08-23 23:23:16 +03:00
azv
5520ae9665 Extract of fixes from 0024682: Move out B-spline cache from curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache
4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx)

5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation.

6. Test cases were modified according to the modern behavior.

7. Changes in BRepLib_CheckCurveOnSurface to use adaptors instead of geometric entities

9. Added methods to access directly poles, knots, multiplicities of BSpline curves and surfaces
2015-08-23 23:21:30 +03:00
aml
f44d9449e4 0026063: GeomAPI_ExtremaCurveSurface have inexact API
Reason of exception was eliminated.

Test-case for issue #26063
2015-08-21 10:59:15 +03:00
pkv
b96d3ed29d 0026263: Inconsistent results of bopargcheck snd checkcurveonsurf commands.
Changes:
class BOPTest
- static function:
Standard_Integer checkcurveonsurf(Draw_Interpretor& di,
                                  Standard_Integer n,
                                  const char** a)
has been changed.
The condition that provides selection of faulty curves has been modified
to be coherent with the same condition in  class BOPAlgo_Analyzer.
2015-08-21 10:59:14 +03:00
abv
5b27fad6ce 0026262: mixing qvector.h and math_Memory.hxx won't compile
Files math_Memory.cxx and .hxx removed: function memmove() should be available on all modern platforms in standard C library
2015-08-21 10:59:13 +03:00
aml
9f1bb68f68 0026044: Optimize math_GlobOptMin class to enter options for solutions of some specified problems
Possibility to search single optimum added.
2015-08-21 10:59:12 +03:00
dbp
6c3dff3505 0026180: Modeling Algorithms - Provide shape self-intersection detector
Small correction of test case for issue CR26180

Fix GCC compilation warnings.
2015-08-21 10:59:11 +03:00
apn
114aa0dcf6 Added parameter highlight_percent in command testdiff.
It highlights considerable (>value in %) deviations of CPU and memory (default value is 5%).
2015-08-21 10:59:10 +03:00
apn
8b318a2ed9 0026237: Change platform in TODOs from Debian\Mandriva to Linux
Change platform in occt test cases in TODOs from Debian\Mandriva to Linux

Small corrections in test cases. Return procedure _tests_platform_def.
2015-08-21 10:59:09 +03:00
azn
1edc472052 0025923: Remove small wires on face read from STEP
The analysis of small area in the method ShapeAnalysis_Wire::CheckSmallArea is performed the following way:
- On the fisrt step algorithm produces a rough estimation of part of surface area.
- In a case if obtained estimation is less than tolerance then evaluate real area and comapre this value with tolerance.
- New flag has been added to XSTEPResource/IGES. In a case if flag is true the faces with small 3d area is removed from ShapeFix context.

Test-case for issue #25923 and update test-cases in de group according to the new behavior.
2015-08-21 10:59:08 +03:00
dbp
7197da1a33 0026220: Visualization - In Graphic3d_Structure use single NCollection_IndexedMap instead of NCollection_DataMap and NCollection_Sequence 2015-08-21 10:59:07 +03:00
dbp
b34ca16935 0026199: Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance
This patch improves performance of OpenGl_BVHClipPrimitiveSet. In particular, on the attached test case for 90 000 spheres the results are the following:

1) Master: vdisplay - 55 sec, 5 FPS, 1.4 GB memory, vclear - 180 sec.
2) Branch: vdisplay - 1.3 sec, 5 FPS, 1.4 GB memory, vclear - 90 sec.

So, the patch improves vdisplay in ~40 times, and vclear in ~2 times without extra memory and with no impact on rendering performance. However, the vclear time is still significant. According to profile results, it is due to Graphic3d_Structure::DisconnectAll method.

Test case for issue CR26199

Fix invalid warnings in 'vdefaults' command.
2015-08-21 10:59:06 +03:00
vpa
c8dad3b06c 0026209: Visualization - provide a method to fit view to the specific bounding box
Methods V3d_View::FitAll and NIS_View::FitAll3d now take arbitrary bounding box as a parameter;
Option -selected added to vfit command to fit only selected entities in Draw;
F key press now fits selected objects if any by default.
2015-08-21 10:59:05 +03:00
apl
6d3066d9b8 0026082: When view is resized horizontally the visualization is not scaled 2015-08-21 10:59:04 +03:00
abv
f8fdf72ad2 0026232: Multithreaded crash in IntAna_Int3Pln::Perform due to statics
"Static" keyword removed from local variable declarations in IntAna_Int3Pln::Perform()
2015-08-21 10:59:03 +03:00
jgv
f0ab769c94 0026201: Wrong processing of dissymetric chamfer: order of chords unjustly changes
Test-case for issue #26201
2015-08-21 10:59:02 +03:00
apl
fd75a870c5 0026163: Visualization - AIS_Shape::SetWidth() should not overwrite the free boundary color 2015-08-21 10:59:01 +03:00
ski
0fcd05c599 0026226: Can't compile and run OCC mfs samples
Files ISession2D_SensitiveCurve.h and ISession2D_SensitiveCurve.cpp were removed from mfc Geometry sample.
Output directory for mfcsample project was changed from lib/libd to bin/bind.
2015-08-21 10:59:00 +03:00
nbv
15655a8ba3 0026197: Incomplete intersection curve
Correct the algorithm to get right Start point for extension of the walking line.

Test case for issue CR26197

Correction of test case bugs/modalg_6/bug26197
2015-08-21 10:58:59 +03:00
anv
bcd2ec1031 0025763: SSP sample is unable to build the proper surface on the given cloud of points
Some improvements to work with periodic splines
2015-08-21 10:58:58 +03:00
vpa
213046ff8a 0026217: Visualization, Select3D_SensitiveCircle - fix compilation with CLang for iOS
Inclusion detection for filled sensitive circles was corrected
2015-08-21 10:58:57 +03:00
pkv
ab1be48a6a 0026224: Wrong result obtained by Common operator.
Changes:
class BOPTools_AlgoTools2D
 - method:
Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
(const TopoDS_Edge& aE2,
const TopoDS_Edge& aE1,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& aCtx)
has been changed.
The treatment of the curves that need to be reversed has been modified
taking into account reversed parameter

Test case for issue CR26224
2015-08-21 10:58:56 +03:00
emv
f00e46680f 0026218: Wrong result done by General Fuse algorithm
class BOPAlgo_PaveFiller
1. method
  void BOPAlgo_PaveFiller::MakeBlocks()
 Update of FaceInfo IN information before filling the maps.

2. methods
  void BOPAlgo_PaveFiller::UpdateFaceInfo
    (BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME,
     const BOPCol_DataMapOfIntegerInteger& theDMV)

  void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
    (const Standard_Integer theInt,
     const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
     const BOPCol_DataMapOfIntegerListOfInteger& aDMBV,
     BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
     BOPCol_DataMapOfShapeInteger& aMVI,
     BOPDS_MapOfPaveBlock& aMPB)

  Small changes in treatment of existing pave blocks when making new ones from intersection curves.

Test case for issue CR26218

Correction of test case for issue CR26218
2015-08-21 10:58:55 +03:00
apn
295990967f Update of testing cases for Debian 7.0 64 bit 2015-08-21 10:58:54 +03:00
ibs
49c44da2ad 0025750: Coding rules - eliminate GCC warning -Wunused-but-set-variable in OSD_signal.cxx for Android build
Move variable aSigInfo to the proper scope.
2015-08-21 10:58:53 +03:00
apn
7f2a0207a7 0026192: Porting testing database on Debian70 64bit
Modified test cases for platform Debian70 64bit

Changed todo mapping for Debian70-64
2015-08-21 10:58:52 +03:00
jgv
813378a1a4 0026202: Wrong result of chamfer on cylindrical surface: wrong value of chord
Test case for issue CR26202
2015-08-21 10:58:51 +03:00
msv
24b4a814bf 0026198: ShapeConstruct_ProjectCurveOnSurface builds infinite line instead of bounded curve
Description of the method ShapeConstruct_ProjectCurveOnSurface::Perform has been updated to actual state.
2015-08-21 10:58:50 +03:00
vsr
00e18bf7e4 0026144: Missing operators in gp_GTrsf 2015-08-21 10:58:49 +03:00
pkv
a72c4cb0e7 0026469: Methods Seek(), ChangeSeek() are missing in class NCollection_IndexedDataMap
I. New features:
1.1. class NCollection_IndexedDataMap
 - method:
 const TheItemType* Seek(const TheKeyType& theKey1) const
 has been added.
 The method Seek returns pointer to Item by Key.
 Returns NULL if Key was not found.

 - method:
 TheItemType* ChangeSeek (const TheKeyType& theKey1)
 has been added.
 The method ChangeSeek returns modifiable pointer to Item by Key.
 Returns NULL if Key was not found.

II. Changes:
 No changes.

III. Modified entities:
 packages:
 NCollection
2015-08-21 10:58:48 +03:00
BenjaminBihler
06b2381dc9 0026423: Complete documentation of CPnts_AbscissaPoint Adv/Perform methods 2015-08-21 10:58:47 +03:00
kgv
0ccb5dcc03 0026453: NCollection_StlIterator - declare reference getters as const 2015-08-21 10:58:46 +03:00
abv
e5db9d8f50 0026448: Method Prepend() of sequence breaks it if argument is empty sequence
Check for empty input sequence added in methods Append() and Prepend() of TCollection and NCollection sequences.

Test bugs fclasses bug26448 added
2015-08-21 10:58:45 +03:00
anv
72d472e0c7 0026345: Shape Healer application crashes trying to run Shape Processing
Empty element, that was added to the Array, causes an exception while accessing myUserMap

LoadResourceManager is receives environment variable name, but stat is waiting for full path
2015-08-21 10:58:35 +03:00
abv
bd7a454d6c 0026273: Comments to methods are misplaced in gp_Vec.cdl
Location of comments corrected

Grammar fix
2015-08-21 10:58:34 +03:00
myn
83f70fe2b4 0026287: Bug in NCollection_AccAllocator::Free() sometimes causes crash in debug mode 2015-08-21 10:58:33 +03:00
isn
e32b64f095 0024994: missing implematation of constructor: BRepClass_FaceClassifier 2015-08-21 10:58:32 +03:00
dbp
bcbb5d9ba4 0026203: Foundation Classes - provide method ::Swap() for NCollection_IndexedMap and NCollection_IndexedDataMap to transpose map elements
Add new tests in group "perf ncollection".
2015-08-21 10:58:31 +03:00
vsr
cbb329c42c Increment OCCT version up to 6.9.1dev 2015-08-20 08:52:53 +03:00
724 changed files with 16107 additions and 6140 deletions

View File

@@ -746,7 +746,7 @@ then, the *Value* function may be implemented as follows:
Item TCollection_Array1::Value (const Standard_Integer&index) const
{
// where r1 and r2 are the lower and upper bounds of the array
if(index r1 || index > r2) {
if(index < r1 || index > r2) {
OutOfRange::Raise(“Index out of range in Array1::Value”);
}
return contents[index];
@@ -754,26 +754,26 @@ Item TCollection_Array1::Value (const Standard_Integer&index) const
~~~~~
Here validity of the index is first verified using the Lower and Upper functions in order to protect the call.
Normally the caller ensures the index being in the valid range before calling Value(). In this case the above implementation of Value is not optimal since the test done in Value is time-consuming and redundant.
Normally the caller ensures the index being in the valid range before calling <i>Value()</i>. In this case the above implementation of *Value* is not optimal since the test done in *Value* is time-consuming and redundant.
It is a widely used practice to include that kind of protections in a debug build of the program and exclude in release (optimized) build. To support this practice, the macros Raise_if() are provided for every OCCT exception class:
It is a widely used practice to include that kind of protections in a debug build of the program and exclude in release (optimized) build. To support this practice, the macros <i>Raise_if()</i> are provided for every OCCT exception class:
~~~~~
<ErrorTypeName>_Raise_if(condition, “Error message”);
~~~~~
where ErrorTypeName is the exception type, condition is the logical expression leading to the raise of the exception, and Error message is the associated message.
where *ErrorTypeName* is the exception type, *condition* is the logical expression leading to the raise of the exception, and *Error message* is the associated message.
The entire call may be removed by defining one of the pre-processor symbols No_Exception or No_<ErrorTypeName> at compile-time:
The entire call may be removed by defining one of the pre-processor symbols *No_Exception* or <i>No_<ErrorTypeName></i> at compile-time:
~~~~~
#define No_Exception /* remove all raises */
~~~~~
Using this syntax, the Value function becomes:
Using this syntax, the *Value* function becomes:
~~~~~
Item TCollection_Array1::Value (const Standard_Integer&index) const
{
OutOfRange_Raise_if(index r1 || index > r2,
OutOfRange_Raise_if(index < r1 || index > r2,
“index out of range in Array1::Value”);
return contents[index];
}
@@ -789,7 +789,7 @@ A handler of T exception type is a match for a raise expression with an excepti
* T and E are of the same type, or
* T is a supertype of E.
In order to handle system signals as exceptions, make sure to insert macro OCC_CATCH_SIGNALS somewhere in the beginning of the relevant code. The recommended location for it is first statement after opening brace of try {} block.
In order to handle system signals as exceptions, make sure to insert macro *OCC_CATCH_SIGNALS* somewhere in the beginning of the relevant code. The recommended location for it is first statement after opening brace of <i>try {}</i> block.
As an example, consider the exceptions of type *NumericError, Overflow, Underflow* and *ZeroDivide*, where *NumericError* is the parent type of the three others.

View File

@@ -461,24 +461,6 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession_Curve.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -592,7 +574,6 @@
<ClInclude Include="..\..\..\src\GeometryView2D.h" />
<ClInclude Include="..\..\..\src\GeomSources.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_Curve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Curve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Direction.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Point.h" />

View File

@@ -54,9 +54,6 @@
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_Curve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession_Curve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
@@ -106,9 +103,6 @@
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_Curve.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\ISession2D\ISession_Curve.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@@ -461,24 +461,6 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession_Curve.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -592,7 +574,6 @@
<ClInclude Include="..\..\..\src\GeometryView2D.h" />
<ClInclude Include="..\..\..\src\GeomSources.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_Curve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Curve.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Direction.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Point.h" />

View File

@@ -54,9 +54,6 @@
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_Curve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession_Curve.cpp">
<Filter>Source Files\ISession2d</Filter>
</ClCompile>
@@ -106,9 +103,6 @@
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_Curve.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\ISession2D\ISession_Curve.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@@ -999,54 +999,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession_Curve.cpp"
>
@@ -1329,10 +1281,6 @@
RelativePath="..\..\..\src\ISession2D\ISession2D_Curve.h"
>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h"
>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession_Curve.h"
>

View File

@@ -996,54 +996,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession_Curve.cpp"
>
@@ -1326,10 +1278,6 @@
RelativePath="..\..\..\src\ISession2D\ISession2D_Curve.h"
>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession2D_SensitiveCurve.h"
>
</File>
<File
RelativePath="..\..\..\src\ISession2D\ISession_Curve.h"
>

View File

@@ -66,16 +66,16 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc10\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc10\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\win32\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc10\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc10\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\win64\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc10\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc10\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\win32\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc10\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc10\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\win64\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
@@ -112,14 +112,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc10\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc10\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win32\vc10\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc10\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc10\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -156,14 +155,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc10\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc10\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win64\vc10\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc10\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win64\vc10\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -201,13 +199,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc10\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc10\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win32\vc10\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc10\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc10\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -246,13 +243,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc10\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc10\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win64\vc10\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc10\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win64\vc10\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>

View File

@@ -70,16 +70,16 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc11\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc11\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\win32\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc11\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc11\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\win64\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc11\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc11\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\win32\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc11\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc11\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\win64\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
@@ -116,14 +116,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc11\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc11\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win32\vc11\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc11\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc11\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -160,14 +159,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc11\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc11\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win64\vc11\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc11\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win64\vc11\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -205,13 +203,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc11\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc11\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win32\vc11\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc11\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc11\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -250,13 +247,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc11\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc11\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win64\vc11\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc11\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win64\vc11\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>

View File

@@ -70,16 +70,16 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc12\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\vc12\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\win32\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc12\libd\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\vc12\bind\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\win64\objd\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc12\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\vc12\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\win32\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc12\lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\vc12\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\win64\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
@@ -116,14 +116,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc12\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc12\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win32\vc12\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc12\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc12\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -160,14 +159,13 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc12\libd/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc12\bind/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>../../../../win64\vc12\libd/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc12\bind/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win64\vc12\libd/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -205,13 +203,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win32\vc12\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win32\vc12\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win32\vc12\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win32\vc12\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc12\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
@@ -250,13 +247,12 @@
</ResourceCompile>
<Link>
<AdditionalDependencies>TKVrml.lib;TKStl.lib;TKBrep.lib;TKIGES.lib;TKShHealing.lib;TKStep.lib;TKXSBase.lib;TKShapeSchema.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKMesh.lib;TKV3d.lib;TKOpenGl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../win64\vc12\lib/mfcsample.dll</OutputFile>
<OutputFile>../../../../win64\vc12\bin/mfcsample.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>../../../../win64\vc12\lib/mfcsample.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>../../../../win64\vc12\bin/mfcsample.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>
</ImportLibrary>
<ImportLibrary>../../../../win32\vc12\lib/mfcsample.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>

View File

@@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../../../win32\vc8\libd"
OutputDirectory="../../../../win32\vc8\bind"
IntermediateDirectory=".\win32\objd"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -81,14 +81,14 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib FWOSPlugin.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win32\vc8\libd/mfcsample.dll"
OutputFile="../../../../win32\vc8\bind/mfcsample.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
GenerateDebugInformation="true"
ProgramDatabaseFile="../../../../win32\vc8\libd/mfcsample.pdb"
ProgramDatabaseFile="../../../../win32\vc8\bind/mfcsample.pdb"
SubSystem="2"
ImportLibrary=""
ImportLibrary="../../../../win32\vc8\libd/mfcsample.lib"
TargetMachine="1"
/>
<Tool
@@ -118,7 +118,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../../../win32\vc8\lib"
OutputDirectory="../../../../win32\vc8\bin"
IntermediateDirectory=".\win32\obj"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -180,13 +180,13 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win32\vc8\lib/mfcsample.dll"
OutputFile="../../../../win32\vc8\bin/mfcsample.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"
ProgramDatabaseFile="../../../../win32\vc8\lib/mfcsample.pdb"
ProgramDatabaseFile="../../../../win32\vc8\bin/mfcsample.pdb"
SubSystem="2"
ImportLibrary=""
ImportLibrary="../../../../win32\vc8\lib/mfcsample.lib"
TargetMachine="1"
/>
<Tool
@@ -216,7 +216,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="../../../../win64\vc8\libd"
OutputDirectory="../../../../win64\vc8\bind"
IntermediateDirectory=".\win64\objd"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -248,7 +248,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(CSF_OPT_INC)&quot;;..\..\..\..\Common"
AdditionalIncludeDirectories="$(CSF_OPT_INC),..\..\..\..\Common"
PreprocessorDefinitions="_DEBUG;WIN64;_WINDOWS;WNT;_AFXEXT;CSFDB;WINVER=0x0500"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -277,14 +277,14 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib FWOSPlugin.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win64\vc8\libd/mfcsample.dll"
OutputFile="../../../../win64\vc8\bind/mfcsample.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB64D)"
GenerateDebugInformation="true"
ProgramDatabaseFile="../../../../win64\vc8\libd/mfcsample.pdb"
ProgramDatabaseFile="../../../../win64\vc8\bind/mfcsample.pdb"
SubSystem="2"
ImportLibrary=""
ImportLibrary="../../../../win64\vc8\libd/mfcsample.lib"
TargetMachine="17"
/>
<Tool
@@ -314,7 +314,7 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="../../../../win64\vc8\lib"
OutputDirectory="../../../../win64\vc8\bin"
IntermediateDirectory=".\win64\obj"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -376,13 +376,13 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win64\vc8\lib/mfcsample.dll"
OutputFile="../../../../win64\vc8\bin/mfcsample.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB64)"
ProgramDatabaseFile="../../../../win64\vc8\lib/mfcsample.pdb"
ProgramDatabaseFile="../../../../win64\vc8\bin/mfcsample.pdb"
SubSystem="2"
ImportLibrary=""
ImportLibrary="../../../../win64\vc8\lib/mfcsample.lib"
TargetMachine="17"
/>
<Tool

View File

@@ -21,7 +21,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../../../win32\vc9\libd"
OutputDirectory="../../../../win32\vc9\bind"
IntermediateDirectory=".\win32\objd"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -82,16 +82,16 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib FWOSPlugin.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win32\vc9\libd/mfcsample.dll"
OutputFile="../../../../win32\vc9\bind/mfcsample.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
GenerateDebugInformation="true"
ProgramDatabaseFile="../../../../win32\vc9\libd/mfcsample.pdb"
ProgramDatabaseFile="../../../../win32\vc9\bind/mfcsample.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
ImportLibrary="../../../../win32\vc9\libd/mfcsample.lib"
TargetMachine="1"
/>
<Tool
@@ -118,7 +118,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="../../../../win64\vc9\libd"
OutputDirectory="../../../../win64\vc9\bind"
IntermediateDirectory=".\win64\objd"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -179,16 +179,16 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib FWOSPlugin.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win64\vc9\libd/mfcsample.dll"
OutputFile="../../../../win64\vc9\bind/mfcsample.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB64D)"
GenerateDebugInformation="true"
ProgramDatabaseFile="../../../../win64\vc9\libd/mfcsample.pdb"
ProgramDatabaseFile="../../../../win64\vc9\bind/mfcsample.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
ImportLibrary="../../../../win64\vc9\libd/mfcsample.lib"
TargetMachine="17"
/>
<Tool
@@ -215,7 +215,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../../../win32\vc9\lib"
OutputDirectory="../../../../win32\vc9\bin"
IntermediateDirectory=".\win32\obj"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -277,15 +277,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win32\vc9\lib/mfcsample.dll"
OutputFile="../../../../win32\vc9\bin/mfcsample.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"
ProgramDatabaseFile="../../../../win32\vc9\lib/mfcsample.pdb"
ProgramDatabaseFile="../../../../win32\vc9\bin/mfcsample.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
ImportLibrary="../../../../win32\vc9\lib/mfcsample.lib"
TargetMachine="1"
/>
<Tool
@@ -312,7 +312,7 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="../../../../win64\vc9\lib"
OutputDirectory="../../../../win64\vc9\bin"
IntermediateDirectory=".\win64\obj"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@@ -374,15 +374,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV3d.lib TKOpenGl.lib"
OutputFile="../../../../win64\vc9\lib/mfcsample.dll"
OutputFile="../../../../win64\vc9\bin/mfcsample.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(CSF_OPT_LIB64)"
ProgramDatabaseFile="../../../../win64\vc9\lib/mfcsample.pdb"
ProgramDatabaseFile="../../../../win64\vc9\bin/mfcsample.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
ImportLibrary="../../../../win64\vc9\lib/mfcsample.lib"
TargetMachine="17"
/>
<Tool

View File

@@ -1,10 +1,12 @@
# Creation of 2d drawing
#Category: Modeling
#Title: Snowflake - creation of 2d geometry
#Category: Modeling
#Title: Snowflake - creation of 2d drawing
pload MODELING AISV
puts "Generating sample drawing of snowflake..."
# make circular elements
circle c11 5 5 0 5
circle c12 5 5 0 3
@@ -121,10 +123,22 @@ eval compound [explode scale w] scale
eval compound [explode mass w] mass
compound sample occ name material sheets scale mass text
compound snowflake frame text drawing
compound snowflake lines text drawing
# display in 3d view
vinit Driver1/Viewer1/View1 w=1024 h=768
vdisplay snowflake lines text
vsetcolor snowflake 0 0 0
vsetcolor lines 0 0 0
vsetcolor text 0 0 0
vsetcolorbg 255 255 255
vtop
vfit
vfit
# add dimension
explode snowflake v
vdimension length -length -shapes snowflake_93 snowflake_15 -plane xoy -value 0.001 -dispunits mm -showunits -flyout 70 -label above -color black -text 5 3d sh
if { [regexp HAVE_GL2PS [dversion]] } {
puts "You can use command vexport to generate PDF: vexport your_file_path.pdf"
}

View File

@@ -1942,6 +1942,16 @@ is
ClearActiveSensitive(me:mutable;aView:View from V3d) is static;
FitSelected (me : mutable;
theView : View from V3d;
theMargin : Real from Standard = 0.01;
theToUpdate : Boolean from Standard = Standard_True)
is static;
---Level: Public
---Purpose: Fits the view correspondingly to the bounds of selected objects.
-- Infinite objects are ignored if infinite state of AIS_InteractiveObject
-- is set to true.
DisplayActiveSensitive(me:mutable;

View File

@@ -68,6 +68,9 @@ namespace
return TCollection_AsciiString ("AIS_CurContext_")
+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_AIS_INDEX_CUR));
}
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)> AIS_MapOfObjectOwners;
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)>::Iterator AIS_MapIteratorOfMapOfObjectOwners;
}
//=======================================================================
@@ -2824,3 +2827,65 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
else
return;
}
//=======================================================================
//function : FitSelected
//purpose : Fits the view corresponding to the bounds of selected objects
//=======================================================================
void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
const Standard_Real theMargin,
const Standard_Boolean theToUpdate)
{
Standard_CString aSelName = HasOpenedContext() ?
myLocalContexts (myCurLocalIndex)->SelectionName().ToCString()
: myCurrentName.ToCString();
Bnd_Box aBndSelected;
const Handle(AIS_Selection)& aSelection = AIS_Selection::Selection (aSelName);
AIS_MapOfObjectOwners anObjectOwnerMap;
for (aSelection->Init(); aSelection->More(); aSelection->Next())
{
const Handle(AIS_InteractiveObject)& anObj =
Handle(AIS_InteractiveObject)::DownCast (aSelection->Value());
if (!anObj.IsNull())
{
if (anObj->IsInfinite())
continue;
Bnd_Box aTmpBnd;
anObj->BoundingBox (aTmpBnd);
aBndSelected.Add (aTmpBnd);
}
else
{
const Handle(SelectMgr_EntityOwner)& anOwner =
Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value());
if (anOwner.IsNull())
continue;
Handle(SelectMgr_IndexedMapOfOwner) anOwnerMap;
if (!anObjectOwnerMap.Find (anOwner->Selectable(), anOwnerMap))
{
anOwnerMap = new SelectMgr_IndexedMapOfOwner();
anObjectOwnerMap.Bind (anOwner->Selectable(), anOwnerMap);
}
anOwnerMap->Add (anOwner);
}
}
for (AIS_MapIteratorOfMapOfObjectOwners anIter (anObjectOwnerMap); anIter.More(); anIter.Next())
{
const Handle(SelectMgr_SelectableObject) anObject = anIter.Key();
Bnd_Box aTmpBox = anObject->BndBoxOfSelected (anIter.ChangeValue());
aBndSelected.Add (aTmpBox);
}
anObjectOwnerMap.Clear();
if (aBndSelected.IsVoid())
return;
theView->FitAll (aBndSelected, theMargin, theToUpdate);
}

View File

@@ -1079,7 +1079,7 @@ Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::SelectedOwner() const
//function : EntityOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::EntityOwners(SelectMgr_IndexedMapOfOwner& theOwners,
void AIS_InteractiveContext::EntityOwners(Handle(SelectMgr_IndexedMapOfOwner)& theOwners,
const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Integer theMode) const
{
@@ -1092,6 +1092,9 @@ void AIS_InteractiveContext::EntityOwners(SelectMgr_IndexedMapOfOwner& theOwners
else
aModes.Append( theMode );
if (theOwners.IsNull())
theOwners = new SelectMgr_IndexedMapOfOwner();
TColStd_ListIteratorOfListOfInteger anItr( aModes );
for (; anItr.More(); anItr.Next() )
{
@@ -1110,7 +1113,7 @@ void AIS_InteractiveContext::EntityOwners(SelectMgr_IndexedMapOfOwner& theOwners
Handle(SelectMgr_EntityOwner) aOwner =
Handle(SelectMgr_EntityOwner)::DownCast(aEntity->OwnerId());
if ( !aOwner.IsNull() )
theOwners.Add( aOwner );
theOwners->Add( aOwner );
}
}
}

View File

@@ -74,6 +74,7 @@ mySM(aCtx->SelectionManager()),
myMainVS(aCtx->MainSelector()),
myFilters(new SelectMgr_OrFilter()),
myAutoHilight(Standard_True),
myMapOfOwner (new SelectMgr_IndexedMapOfOwner()),
mylastindex(0),
mylastgood(0),
myCurDetected(0),
@@ -606,7 +607,7 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
{
ClearDetected();
Clear();
myMapOfOwner.Clear();
myMapOfOwner->Clear();
mylastindex=0;
// clear the selector...
@@ -1050,16 +1051,16 @@ HasFilters(const TopAbs_ShapeEnum aType) const
void AIS_LocalContext::ClearDetected()
{
for(Standard_Integer I=1;I<=myMapOfOwner.Extent();I++)
for(Standard_Integer I=1;I<=myMapOfOwner->Extent();I++)
{
if(!myMapOfOwner(I).IsNull())
if(!myMapOfOwner->FindKey (I).IsNull())
{
if(myMapOfOwner(I)->IsHilighted(myMainPM))
myMapOfOwner(I)->Unhilight(myMainPM);
if(myMapOfOwner->FindKey (I)->IsHilighted(myMainPM))
myMapOfOwner->FindKey (I)->Unhilight(myMainPM);
else
{
const Handle(SelectMgr_SelectableObject)& SO =
myMapOfOwner.FindKey(I)->Selectable();
myMapOfOwner->FindKey (I)->Selectable();
if(myActiveObjects.IsBound(SO))
{
const Handle(AIS_LocalStatus)& Att = myActiveObjects(SO);
@@ -1068,7 +1069,7 @@ void AIS_LocalContext::ClearDetected()
Att->DisplayMode()==-1 &&
Att->SelectionModes().IsEmpty())
{
myMapOfOwner(I)->Clear(myMainPM);
myMapOfOwner->FindKey (I)->Clear(myMainPM);
}
}
}

View File

@@ -61,4 +61,4 @@ inline Standard_Boolean AIS_LocalContext::HasNextDetected() const
{return myCurDetected<myDetectedSeq.Length();}
inline Standard_Boolean AIS_LocalContext::IsValidIndex(const Standard_Integer indx) const
{ return (indx>0 && indx<=myMapOfOwner.Extent());}
{ return (indx>0 && indx<=myMapOfOwner->Extent());}

View File

@@ -95,10 +95,10 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
// result of courses..
if (aDetectedNb == 0 || myDetectedSeq.IsEmpty())
{
if (mylastindex != 0 && mylastindex <= myMapOfOwner.Extent())
if (mylastindex != 0 && mylastindex <= myMapOfOwner->Extent())
{
myMainPM->ClearImmediateDraw();
Unhilight (myMapOfOwner (mylastindex), theView);
Unhilight (myMapOfOwner->FindKey (mylastindex), theView);
if (theToRedrawImmediate)
{
theView->RedrawImmediate();
@@ -148,7 +148,7 @@ AIS_StatusOfPick AIS_LocalContext::Select (const Standard_Boolean toUpdateViewer
return (AIS_Selection::Extent() == 0) ? AIS_SOP_NothingSelected : AIS_SOP_Removed;
}
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner (aDetIndex);
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner->FindKey (aDetIndex);
ClearSelected (Standard_False);
@@ -314,7 +314,7 @@ AIS_StatusOfPick AIS_LocalContext::ShiftSelect (const Standard_Boolean toUpdateV
{
AIS_Selection::SetCurrentSelection (mySelName.ToCString());
Standard_Integer aSelNum = AIS_Selection::Extent();
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner (aDetIndex);
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner->FindKey (aDetIndex);
Standard_Boolean toSelect = anOwner->IsSelected() ? Standard_False : Standard_True;
AIS_Selection::Select (anOwner);
anOwner->SetSelected (toSelect);
@@ -940,9 +940,9 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
// 4. AIS_LocalContext - myMapOfOwner : remove entity owners from myMapOfOwner
SelectMgr_IndexedMapOfOwner anOwnersToKeep;
for (Standard_Integer anIdx = 1; anIdx <= myMapOfOwner.Extent(); anIdx++)
for (Standard_Integer anIdx = 1; anIdx <= myMapOfOwner->Extent(); anIdx++)
{
Handle(SelectMgr_EntityOwner) anOwner = myMapOfOwner (anIdx);
Handle(SelectMgr_EntityOwner) anOwner = myMapOfOwner->FindKey (anIdx);
if (anOwner.IsNull())
{
continue;
@@ -960,9 +960,9 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
}
}
}
myMapOfOwner.Clear();
myMapOfOwner.Assign (anOwnersToKeep);
mylastindex = myMapOfOwner.FindIndex (aLastPicked);
myMapOfOwner->Clear();
myMapOfOwner->Assign (anOwnersToKeep);
mylastindex = myMapOfOwner->FindIndex (aLastPicked);
if (!IsValidIndex (mylastindex))
{
myMainPM->ClearImmediateDraw();
@@ -1159,9 +1159,9 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
//
//=======================================================================================================
const Standard_Integer aNewIndex = myMapOfOwner.Contains (thePickOwner)
? myMapOfOwner.FindIndex (thePickOwner)
: myMapOfOwner.Add (thePickOwner);
const Standard_Integer aNewIndex = myMapOfOwner->Contains (thePickOwner)
? myMapOfOwner->FindIndex (thePickOwner)
: myMapOfOwner->Add (thePickOwner);
// For the advanced mesh selection mode the owner indices comparison
// is not effective because in that case only one owner manage the
@@ -1173,9 +1173,9 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
{
myMainPM->ClearImmediateDraw();
if (mylastindex != 0
&& mylastindex <= myMapOfOwner.Extent())
&& mylastindex <= myMapOfOwner->Extent())
{
const Handle(SelectMgr_EntityOwner)& aLastOwner = myMapOfOwner (mylastindex);
const Handle(SelectMgr_EntityOwner)& aLastOwner = myMapOfOwner->FindKey (mylastindex);
Unhilight (aLastOwner, theView);
}
@@ -1222,7 +1222,7 @@ AIS_LocalContext::DetectedShape() const
static TopoDS_Shape bidsh;
if(mylastindex != 0)
{
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner(mylastindex));
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner->FindKey (mylastindex));
if(BROwnr.IsNull()) return bidsh;
return BROwnr->Shape();
}
@@ -1239,7 +1239,7 @@ AIS_LocalContext::DetectedInteractive() const
{
Handle(AIS_InteractiveObject) Iobj;
if(IsValidIndex(mylastindex)){
Handle(SelectMgr_SelectableObject) SO = myMapOfOwner.FindKey(mylastindex)->Selectable();
Handle(SelectMgr_SelectableObject) SO = myMapOfOwner->FindKey(mylastindex)->Selectable();
Iobj = *((Handle(AIS_InteractiveObject)*) &SO);
}
return Iobj;
@@ -1252,7 +1252,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::DetectedOwner() const
{
Handle(SelectMgr_EntityOwner) bid;
if(!IsValidIndex(mylastindex)) return bid;
return myMapOfOwner.FindKey(mylastindex);
return myMapOfOwner->FindKey(mylastindex);
}
@@ -1263,7 +1263,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::DetectedOwner() const
Standard_Boolean AIS_LocalContext::ComesFromDecomposition(const Standard_Integer PickedIndex) const
{
const Handle(SelectMgr_EntityOwner)& OWN = myMapOfOwner.FindKey(PickedIndex);
const Handle(SelectMgr_EntityOwner)& OWN = myMapOfOwner->FindKey(PickedIndex);
Handle(SelectMgr_SelectableObject) aSel = OWN->Selectable();
if (myActiveObjects.IsBound (aSel)) { // debug of jmi
const Handle(AIS_LocalStatus)& Stat = myActiveObjects(aSel);
@@ -1300,7 +1300,7 @@ void AIS_LocalContext::ClearSensitive(const Handle(V3d_View)& aviou)
Standard_Boolean AIS_LocalContext::IsShape(const Standard_Integer Index) const
{
if(Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner.FindKey(Index)).IsNull())
if(Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner->FindKey(Index)).IsNull())
return Standard_False;
return
ComesFromDecomposition(Index);
@@ -1383,12 +1383,12 @@ Standard_Boolean AIS_LocalContext::UnhilightLastDetected (const Handle(V3d_View)
}
myMainPM->BeginImmediateDraw();
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner (mylastindex);
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner->FindKey (mylastindex);
const Standard_Integer aHilightMode = anOwner->HasSelectable()
? GetHiMod (Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable()))
: 0;
myMapOfOwner (mylastindex)->Unhilight (myMainPM, aHilightMode);
myMapOfOwner->FindKey (mylastindex)->Unhilight (myMainPM, aHilightMode);
myMainPM->EndImmediateDraw (theView);
mylastindex = 0;
return Standard_True;
@@ -1454,8 +1454,10 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
Standard_Boolean found(Standard_False);
if (!found) {
NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (myMainVS->ActiveOwners());
for (; anOwnersIt.More(); anOwnersIt.Next()) {
NCollection_List<Handle(SelectBasics_EntityOwner)> anActiveOwners;
myMainVS->ActiveOwners (anActiveOwners);
for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (anActiveOwners); anOwnersIt.More(); anOwnersIt.Next())
{
EO = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
if (!BROwnr.IsNull() && BROwnr->HasShape() && BROwnr->Shape() == sh) {

View File

@@ -474,10 +474,30 @@ void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
}
}
// disable dedicated line aspects
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
theDrawer->SetUnFreeBoundaryAspect(theDrawer->LineAspect());
theDrawer->SetSeenLineAspect (theDrawer->LineAspect());
if (!theDrawer->HasOwnFreeBoundaryAspect())
{
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
}
}
if (!theDrawer->HasOwnUnFreeBoundaryAspect())
{
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
}
}
if (!theDrawer->HasOwnSeenLineAspect())
{
theDrawer->SetSeenLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->SeenLineAspect()->Aspect() = *theDrawer->Link()->SeenLineAspect()->Aspect();
}
}
// override color
theDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
@@ -485,6 +505,9 @@ void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
theDrawer->LineAspect()->SetColor (theColor);
theDrawer->WireAspect()->SetColor (theColor);
theDrawer->PointAspect()->SetColor (theColor);
theDrawer->FreeBoundaryAspect()->SetColor (theColor);
theDrawer->UnFreeBoundaryAspect()->SetColor (theColor);
theDrawer->SeenLineAspect()->SetColor (theColor);
}
//=======================================================================
@@ -695,14 +718,37 @@ void AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
}
}
// disable dedicated line aspects
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
theDrawer->SetUnFreeBoundaryAspect(theDrawer->LineAspect());
theDrawer->SetSeenLineAspect (theDrawer->LineAspect());
if (!theDrawer->HasOwnFreeBoundaryAspect())
{
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
}
}
if (!theDrawer->HasOwnUnFreeBoundaryAspect())
{
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
}
}
if (!theDrawer->HasOwnSeenLineAspect())
{
theDrawer->SetSeenLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
if (theDrawer->HasLink())
{
*theDrawer->SeenLineAspect()->Aspect() = *theDrawer->Link()->SeenLineAspect()->Aspect();
}
}
// override width
theDrawer->LineAspect()->SetWidth (theLineWidth);
theDrawer->WireAspect()->SetWidth (theLineWidth);
theDrawer->FreeBoundaryAspect()->SetWidth (theLineWidth);
theDrawer->UnFreeBoundaryAspect()->SetWidth (theLineWidth);
theDrawer->SeenLineAspect()->SetWidth (theLineWidth);
}
//=======================================================================

View File

@@ -766,14 +766,15 @@ gp_Circ Adaptor3d_IsoCurve::Circle() const
case GeomAbs_SurfaceOfRevolution:
{
if (myIso == GeomAbs_IsoV) {
gp_Ax1 Ax1 = mySurface->AxeOfRevolution();
gp_Vec DX(Ax1.Location(), Value(0));
if(DX.IsParallel(Ax1.Direction(),Precision::Angular())) {
return gp_Circ(gp_Ax2(Value(0), Ax1.Direction()),0);
const gp_Pnt aVal0 = Value (0.0);
gp_Ax1 Ax1 = mySurface->AxeOfRevolution();
if (gp_Lin (Ax1).Contains (aVal0, Precision::Confusion())) {
return gp_Circ(gp_Ax2(aVal0, Ax1.Direction()),0);
}
else {
gp_Vec DX(Ax1.Location(), aVal0);
axes = gp_Ax3(Ax1.Location(), Ax1.Direction(), DX);
computeHR(axes,Value(0),h,radius);
computeHR(axes,aVal0,h,radius);
gp_Vec VT = axes.Direction();
axes.Translate(VT * h);
return gp_Circ(axes.Ax2(),radius);

View File

@@ -14,6 +14,31 @@
#include <BOPAlgo_ArgumentAnalyzer.ixx>
#include <BOPAlgo_ArgumentAnalyzer.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPAlgo_CheckerSI.hxx>
#include <BOPAlgo_Operation.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_SequenceOfShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_MapOfPassKey.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BRep_Builder.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_TFace.hxx>
#include <BRep_Tool.hxx>
#include <BRep_TVertex.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <IntTools_CommonPrt.hxx>
#include <IntTools_Context.hxx>
#include <IntTools_EdgeEdge.hxx>
#include <IntTools_Range.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
@@ -30,18 +55,6 @@
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
#include <BRep_TVertex.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_TFace.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
//
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_SequenceOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
@@ -63,6 +76,8 @@
#include <BOPAlgo_CheckerSI.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <TopExp_Explorer.hxx>
// ================================================================================
// function: Constructor
// purpose:
@@ -825,10 +840,9 @@ void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
// ================================================================================
void BOPAlgo_ArgumentAnalyzer::TestContinuity()
{
Standard_Integer i;
Standard_Integer i, j, aNbS;
Standard_Real f, l;
TopExp_Explorer aExp;
BOPCol_MapIteratorOfMapOfShape aIt;
//
for (i = 0; i < 2; ++i) {
const TopoDS_Shape& aS = !i ? myShape1 : myShape2;
@@ -836,7 +850,7 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
continue;
}
//
BOPCol_MapOfShape aMS;
BOPCol_IndexedMapOfShape aMS;
//Edges
aExp.Init(aS, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
@@ -860,9 +874,9 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
}
//
//add shapes with continuity C0 to result
aIt.Initialize(aMS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aFS = aIt.Value();
aNbS = aMS.Extent();
for (j = 1; j <= aNbS; ++j) {
const TopoDS_Shape& aFS = aMS(j);
BOPAlgo_CheckResult aResult;
if(i == 0) {
aResult.SetShape1(myShape1);

View File

@@ -45,14 +45,11 @@
#include <NCollection_DataMap.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
typedef NCollection_DataMap
<BOPTools_Set,
TopoDS_Shape,
BOPTools_SetMapHasher> BOPTools_DataMapOfSetShape;
typedef NCollection_IndexedDataMap
<BOPTools_Set,
TopoDS_Shape,
BOPTools_SetMapHasher> BOPTools_IndexedDataMapOfSetShape;
//
typedef BOPTools_DataMapOfSetShape::Iterator
BOPTools_DataMapIteratorOfDataMapOfSetShape;
static
TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
@@ -535,7 +532,7 @@ void BOPAlgo_BOP::BuildRC()
BOPCol_ListIteratorOfListOfShape aItLS, aItIm;
Standard_Boolean bHasInterf;
Standard_Integer iX;
BOPTools_DataMapOfSetShape aDMSTS;
BOPTools_IndexedDataMapOfSetShape aDMSTS;
//
myErrorStatus=0;
//
@@ -595,7 +592,7 @@ void BOPAlgo_BOP::BuildRC()
//
aST.Add(aSIm, TopAbs_FACE);
//
aDMSTS.Bind(aST, aSIm);
aDMSTS.Add(aST, aSIm);
}
}
}
@@ -660,8 +657,8 @@ void BOPAlgo_BOP::BuildRC()
//
aST.Add(aSIm, TopAbs_FACE);
//
if (aDMSTS.IsBound(aST)) {
const TopoDS_Shape& aSImA=aDMSTS.Find(aST);
if (aDMSTS.Contains(aST)) {
const TopoDS_Shape& aSImA=aDMSTS.FindFromKey(aST);
aBB.Add(aC, aSImA);
}
}
@@ -674,7 +671,7 @@ void BOPAlgo_BOP::BuildRC()
//
aST.Add(aSIm, TopAbs_FACE);
//
bIsBound=aDMSTS.IsBound(aST);
bIsBound=aDMSTS.Contains(aST);
}
//
if (!bIsBound) {
@@ -841,8 +838,7 @@ void BOPAlgo_BOP::BuildSolid()
BOPCol_ListOfShape aSFS;
BOPAlgo_BuilderSolid aSB;
BOPCol_MapOfShape aMSA, aMZ;
BOPTools_DataMapOfSetShape aDMSTS;
BOPTools_DataMapIteratorOfDataMapOfSetShape aItDMSTS;
BOPTools_IndexedDataMapOfSetShape aDMSTS;
//
myErrorStatus=0;
//
@@ -898,8 +894,8 @@ void BOPAlgo_BOP::BuildSolid()
//
aST.Add(aSx, TopAbs_FACE);
//
if (!aDMSTS.IsBound(aST)) {
aDMSTS.Bind(aST, aSx);
if (!aDMSTS.Contains(aST)) {
aDMSTS.Add(aST, aSx);
}
continue;
@@ -996,9 +992,9 @@ void BOPAlgo_BOP::BuildSolid()
aBB.Add(aRC, aSR);
}
//
aItDMSTS.Initialize(aDMSTS);
for (; aItDMSTS.More(); aItDMSTS.Next()) {
const TopoDS_Shape& aSx=aItDMSTS.Value();
aNbSx = aDMSTS.Extent();
for (i = 1; i <= aNbSx; ++i) {
const TopoDS_Shape& aSx = aDMSTS(i);
aBB.Add(aRC, aSx);
}
//

View File

@@ -25,7 +25,7 @@ uses
Shape from TopoDS,
BaseAllocator from BOPCol,
ListOfShape from BOPCol,
MapOfOrientedShape from BOPCol,
IndexedMapOfOrientedShape from BOPCol,
Context from IntTools
--raises
@@ -73,7 +73,7 @@ fields
myLoopsInternal : ListOfShape from BOPCol is protected;
myAreas : ListOfShape from BOPCol is protected;
myShapesToAvoid : MapOfOrientedShape from BOPCol is protected;
myShapesToAvoid : IndexedMapOfOrientedShape from BOPCol is protected;
end BuilderArea;

View File

@@ -16,16 +16,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BOPAlgo_BuilderFace.ixx>
//
#include <NCollection_UBTreeFiller.hxx>
#include <NCollection_DataMap.hxx>
//
#include <TColStd_MapIntegerHasher.hxx>
//
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <Bnd_Box.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPAlgo_WireEdgeSet.hxx>
#include <BOPAlgo_WireSplitter.hxx>
#include <BOPCol_Box2DBndTree.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <BRepTools.hxx>
#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
//
@@ -58,18 +67,8 @@
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BOPAlgo_WireEdgeSet.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPTools.hxx>
#include <BOPCol_ListOfShape.hxx>
//
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_Box2DBndTree.hxx>
//
#include <BOPAlgo_WireSplitter.hxx>
static
Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
const BOPCol_IndexedMapOfShape& );
@@ -79,7 +78,7 @@ static
const TopoDS_Shape& ,
Handle(IntTools_Context)& );
static
void MakeInternalWires(const BOPCol_MapOfShape& ,
void MakeInternalWires(const BOPCol_IndexedMapOfShape& ,
BOPCol_ListOfShape& );
static
void GetWire(const TopoDS_Shape& ,
@@ -132,8 +131,7 @@ class BOPAlgo_ShapeBox2D {
//
typedef NCollection_IndexedDataMap
<Standard_Integer,
BOPAlgo_ShapeBox2D,
TColStd_MapIntegerHasher> BOPAlgo_IndexedDataMapOfIntegerShapeBox2D;
BOPAlgo_ShapeBox2D> BOPAlgo_IndexedDataMapOfIntegerShapeBox2D;
typedef NCollection_IndexedDataMap
<TopoDS_Shape,
@@ -333,9 +331,8 @@ void BOPAlgo_BuilderFace::PerformLoops()
myErrorStatus=0;
//
Standard_Boolean bFlag;
Standard_Integer iErr, aNbEA;
Standard_Integer i, iErr, aNbEA;
BOPCol_ListIteratorOfListOfShape aIt;
BOPCol_MapIteratorOfMapOfOrientedShape aItM;
BOPCol_IndexedDataMapOfShapeListOfShape aVEMap;
BOPCol_MapOfOrientedShape aMAdded;
TopoDS_Iterator aItW;
@@ -384,9 +381,9 @@ void BOPAlgo_BuilderFace::PerformLoops()
}
//
// b. collect all edges that are to avoid
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aE=aItM.Key();
aNbEA = myShapesToAvoid.Extent();
for (i = 1; i <= aNbEA; ++i) {
const TopoDS_Shape& aE = myShapesToAvoid(i);
aMEP.Add(aE);
}
//
@@ -402,10 +399,9 @@ void BOPAlgo_BuilderFace::PerformLoops()
// 2. Internal Wires
myLoopsInternal.Clear();
//
aNbEA=myShapesToAvoid.Extent();
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aEE=aItM.Key();
aNbEA = myShapesToAvoid.Extent();
for (i = 1; i <= aNbEA; ++i) {
const TopoDS_Shape& aEE = myShapesToAvoid(i);
BOPTools::MapShapesAndAncestors(aEE,
TopAbs_VERTEX,
TopAbs_EDGE,
@@ -413,9 +409,8 @@ void BOPAlgo_BuilderFace::PerformLoops()
}
//
bFlag=Standard_True;
aItM.Initialize(myShapesToAvoid);
for (; aItM.More()&&bFlag; aItM.Next()) {
const TopoDS_Shape& aEE=aItM.Key();
for (i = 1; (i <= aNbEA) && bFlag; ++i) {
const TopoDS_Shape& aEE = myShapesToAvoid(i);
if (!aMAdded.Add(aEE)) {
continue;
}
@@ -445,8 +440,9 @@ void BOPAlgo_BuilderFace::PerformLoops()
}//for (; aIt.More(); aIt.Next()) {
}//for (; aItE.More(); aItE.Next()) {
}//for (; aItW.More(); aItW.Next()) {
aW.Closed(BRep_Tool::IsClosed(aW));
myLoopsInternal.Append(aW);
}//for (; aItM.More(); aItM.Next()) {
}//for (i = 1; (i <= aNbEA) && bFlag; ++i) {
}
//=======================================================================
//function : PerformAreas
@@ -705,11 +701,11 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
}
//
//Standard_Real aTol;
Standard_Integer i;
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfShape aIt1, aIt2;
TopoDS_Iterator aIt;
BOPCol_MapOfShape aME, aMEP;
BOPCol_MapIteratorOfMapOfShape aItME;
BOPCol_IndexedMapOfShape aME1, aME2, aMEP;
BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
BOPCol_ListOfShape aLSI;
//
@@ -720,10 +716,9 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
aIt.Initialize(aWire);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
aME.Add(aE);
aME1.Add(aE);
}
}
aNbWI=aME.Extent();
//
// 2 Process faces
aIt2.Initialize(myAreas);
@@ -734,13 +729,17 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
BOPTools::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
//
// 2.1 Separate faces to process aMEP
aME2.Clear();
aMEP.Clear();
aItME.Initialize(aME);
for (; aItME.More(); aItME.Next()) {
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aItME.Key()));
aNbWI = aME1.Extent();
for (i = 1; i <= aNbWI; ++i) {
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aME1(i)));
if (IsInside(aE, aF, myContext)) {
aMEP.Add(aE);
}
else {
aME2.Add(aE);
}
}
//
// 2.2 Make Internal Wires
@@ -755,13 +754,9 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
}
//
// 2.4 Remove faces aMFP from aMF
aItME.Initialize(aMEP);
for (; aItME.More(); aItME.Next()) {
const TopoDS_Shape& aE=aItME.Key();
aME.Remove(aE);
}
aME1 = aME2;
//
aNbWI=aME.Extent();
aNbWI = aME1.Extent();
if (!aNbWI) {
break;
}
@@ -771,24 +766,23 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
//function : MakeInternalWires
//purpose :
//=======================================================================
void MakeInternalWires(const BOPCol_MapOfShape& theME,
void MakeInternalWires(const BOPCol_IndexedMapOfShape& theME,
BOPCol_ListOfShape& theWires)
{
BOPCol_MapIteratorOfMapOfShape aItM;
Standard_Integer i, aNbE;
BOPCol_MapOfShape aAddedMap;
BOPCol_ListIteratorOfListOfShape aItE;
BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
BRep_Builder aBB;
//
aItM.Initialize(theME);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aE=aItM.Key();
aNbE = theME.Extent();
for (i = 1; i <= aNbE; ++i) {
const TopoDS_Shape& aE = theME(i);
BOPTools::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
//
aItM.Initialize(theME);
for (; aItM.More(); aItM.Next()) {
TopoDS_Shape aEE=aItM.Key();
for (i = 1; i <= aNbE; ++i) {
TopoDS_Shape aEE = theME(i);
if (!aAddedMap.Add(aEE)) {
continue;
}
@@ -817,6 +811,7 @@ void MakeInternalWires(const BOPCol_MapOfShape& theME,
}
}
}
aW.Closed(BRep_Tool::IsClosed(aW));
theWires.Append(aW);
}
}

View File

@@ -15,16 +15,30 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//
#include <BOPAlgo_BuilderSolid.ixx>
//
#include <NCollection_List.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <NCollection_IncAllocator.hxx>
//
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <BOPAlgo_BuilderSolid.hxx>
#include <BOPAlgo_ShellSplitter.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeShape.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BOPTools_CoupleOfShape.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
//
@@ -47,34 +61,12 @@
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
//
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
//
#include <BRepBndLib.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
//
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfOrientedShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_BoxBndTree.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
//
#include <BOPTools.hxx>
#include <BOPTools_CoupleOfShape.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools3D.hxx>
//
#include <Precision.hxx>
#include <IntTools_Context.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_UBTreeFiller.hxx>
//
#include <BOPAlgo_ShellSplitter.hxx>
static
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
const BOPCol_IndexedMapOfShape& );
@@ -86,7 +78,7 @@ static
const TopoDS_Shape& ,
Handle(IntTools_Context)& );
static
void MakeInternalShells(const BOPCol_MapOfShape& ,
void MakeInternalShells(const BOPCol_IndexedMapOfShape& ,
BOPCol_ListOfShape& );
//=======================================================================
@@ -261,14 +253,7 @@ typedef BOPCol_ContextCnt
Handle(IntTools_Context)> BOPAlgo_FaceSolidCnt;
//
//=======================================================================
typedef NCollection_DataMap
<TopoDS_Shape,
gp_Pnt,
TopTools_ShapeMapHasher> BOPAlgo_DataMapOfShapePnt;
typedef BOPAlgo_DataMapOfShapePnt::Iterator
BOPAlgo_DataMapIteratorOfDataMapOfShapePnt;
//
//=======================================================================
//function :
//purpose :
@@ -448,10 +433,9 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
//=======================================================================
void BOPAlgo_BuilderSolid::PerformLoops()
{
Standard_Integer iErr;
Standard_Integer iErr, i, aNbSh;
BOPCol_ListIteratorOfListOfShape aIt;
TopoDS_Iterator aItS;
BOPCol_MapIteratorOfMapOfOrientedShape aItM;
Handle(NCollection_BaseAllocator) aAlr;
//
myErrorStatus=0;
@@ -512,9 +496,9 @@ void BOPAlgo_BuilderSolid::PerformLoops()
}
//
// b. collect all edges that are to avoid
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aNbSh = myShapesToAvoid.Extent();
for (i = 1; i <= aNbSh; ++i) {
const TopoDS_Shape& aF = myShapesToAvoid(i);
aMP.Add(aF);
}
//
@@ -536,17 +520,16 @@ void BOPAlgo_BuilderSolid::PerformLoops()
aEFMap.Clear();
AddedFacesMap.Clear();
//
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFF=aItM.Key();
aNbSh = myShapesToAvoid.Extent();
for (i = 1; i <= aNbSh; ++i) {
const TopoDS_Shape& aFF = myShapesToAvoid(i);
BOPTools::MapShapesAndAncestors(aFF,
TopAbs_EDGE, TopAbs_FACE,
aEFMap);
}
//
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFF=aItM.Key();
for (i = 1; i <= aNbSh; ++i) {
const TopoDS_Shape& aFF = myShapesToAvoid(i);
if (!AddedFacesMap.Add(aFF)) {
continue;
}
@@ -585,11 +568,11 @@ void BOPAlgo_BuilderSolid::PerformLoops()
void BOPAlgo_BuilderSolid::PerformAreas()
{
Standard_Boolean bIsGrowth, bIsHole;
Standard_Integer k;
Standard_Integer i, k, aNbInOut, aNbMSH;
BRep_Builder aBB;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_ListOfShape aNewSolids, aHoleShells;
BOPCol_DataMapOfShapeShape aInOutMap;
BOPCol_IndexedDataMapOfShapeShape aInOutMap;
BOPCol_IndexedMapOfShape aMHF;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPCol_BoxBndTreeSelector aSelector;
@@ -597,10 +580,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
NCollection_UBTreeFiller
<Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
BOPAlgo_DataMapOfIntegerBSSB aDMISB(100);
BOPCol_IndexedDataMapOfShapeListOfShape aMSH;
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB;
BOPCol_DataMapOfShapeListOfShape aMSH;
BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
//
myErrorStatus=0;
//
@@ -698,42 +679,41 @@ void BOPAlgo_BuilderSolid::PerformAreas()
continue;
}
//
if (aInOutMap.IsBound (aHole)){
const TopoDS_Shape& aSolidWas=aInOutMap(aHole);
if (aInOutMap.Contains (aHole)){
const TopoDS_Shape& aSolidWas = aInOutMap.FindFromKey(aHole);
if (IsInside(aSolid, aSolidWas, myContext)) {
aInOutMap.UnBind(aHole);
aInOutMap.Bind (aHole, aSolid);
aInOutMap.ChangeFromKey(aHole) = aSolid;
}
}
else{
aInOutMap.Bind(aHole, aSolid);
aInOutMap.Add(aHole, aSolid);
}
}
}//for (; aItDMISB.More(); aItDMISB.Next()) {
}//for (i = 1; i <= aNbDMISB; ++i) {
//
// 5. Map [Solid/Holes] -> aMSH
aItDMSS.Initialize(aInOutMap);
for (; aItDMSS.More(); aItDMSS.Next()) {
const TopoDS_Shape& aHole=aItDMSS.Key();
const TopoDS_Shape& aSolid=aItDMSS.Value();
aNbInOut = aInOutMap.Extent();
for (i = 1; i <= aNbInOut; ++i) {
const TopoDS_Shape& aHole = aInOutMap.FindKey(i);
const TopoDS_Shape& aSolid = aInOutMap(i);
//
if (aMSH.IsBound(aSolid)) {
BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
if (aMSH.Contains(aSolid)) {
BOPCol_ListOfShape& aLH = aMSH.ChangeFromKey(aSolid);
aLH.Append(aHole);
}
else {
BOPCol_ListOfShape aLH;
aLH.Append(aHole);
aMSH.Bind(aSolid, aLH);
aMSH.Add(aSolid, aLH);
}
}
//
// 6. Add aHoles to Solids
aItMSH.Initialize(aMSH);
for (; aItMSH.More(); aItMSH.Next()) {
TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&aItMSH.Key()));
aNbMSH = aMSH.Extent();
for (i = 1; i <= aNbMSH; ++i) {
TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&(aMSH.FindKey(i))));
const BOPCol_ListOfShape& aLH = aMSH(i);
//
const BOPCol_ListOfShape& aLH=aItMSH.Value();
aItLS.Initialize(aLH);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aHole = aItLS.Value();
@@ -758,7 +738,7 @@ void BOPAlgo_BuilderSolid::PerformAreas()
aItLS.Initialize(aHoleShells);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aHole = aItLS.Value();
if (!aInOutMap.IsBound(aHole)){
if (!aInOutMap.Contains(aHole)){
TopoDS_Solid aSolid;
//
aBB.MakeSolid(aSolid);
@@ -787,7 +767,7 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
TopoDS_Iterator aIt;
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aItLS;
BOPCol_MapOfShape aMFs;
BOPCol_IndexedMapOfShape aMFs;
BOPCol_ListOfShape aLSI;
BOPAlgo_VectorOfFaceSolid aVFS;
BOPAlgo_VectorOfFacePnt aVFP;
@@ -807,7 +787,9 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
for (; aIt.More(); aIt.Next()) {
const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
//
if (aMFs.Add(aF)) {
if (!aMFs.Contains(aF)) {
aMFs.Add(aF);
//
gp_Pnt aP;
gp_Pnt2d aP2D;
//
@@ -985,27 +967,25 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
//function : MakeInternalShells
//purpose :
//=======================================================================
void MakeInternalShells(const BOPCol_MapOfShape& theMF,
void MakeInternalShells(const BOPCol_IndexedMapOfShape& theMF,
BOPCol_ListOfShape& theShells)
{
BOPCol_ListIteratorOfListOfShape aItF;
Standard_Integer i, aNbF;
BRep_Builder aBB;
//
BOPCol_ListIteratorOfListOfShape aItF;
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
BOPCol_MapIteratorOfMapOfShape aItM;
BOPCol_MapOfShape aAddedFacesMap;
//
aItM.Initialize(theMF);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aNbF = theMF.Extent();
for (i = 1; i <= aNbF; ++i) {
TopoDS_Shape aF = theMF(i);
BOPTools::MapShapesAndAncestors(aF,
TopAbs_EDGE, TopAbs_FACE,
aMEF);
}
//
aItM.Initialize(theMF);
for (; aItM.More(); aItM.Next()) {
TopoDS_Shape aFF=aItM.Key();
for (i = 1; i <= aNbF; ++i) {
TopoDS_Shape aFF = theMF(i);
if (!aAddedFacesMap.Add(aFF)) {
continue;
}

View File

@@ -34,6 +34,12 @@
#include <BOPDS_ShapeInfo.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <IntTools_Context.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : FillImagesVertices
@@ -143,19 +149,19 @@
aType=aS.ShapeType();
if (aType==theType) {
if (myImages.IsBound(aS)){
const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSIm=aItIm.Value();
if (aM.Add(aSIm)) {
aBB.Add(myShape, aSIm);
}
}
const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSIm=aItIm.Value();
if (aM.Add(aSIm)) {
aBB.Add(myShape, aSIm);
}
}
}
else {
if (aM.Add(aS)) {
aBB.Add(myShape, aS);
}
if (aM.Add(aS)) {
aBB.Add(myShape, aS);
}
}
}
}
@@ -241,6 +247,8 @@
}
}
//
aCIm.Closed(BRep_Tool::IsClosed(aCIm));
//
BOPCol_ListOfShape aLSIm(myAllocator);
aLSIm.Append(aCIm);
myImages.Bind(theS, aLSIm);
@@ -288,9 +296,9 @@
const BOPCol_ListOfShape& aLFIm=myImages.Find(aSX);
aItIm.Initialize(aLFIm);
for (; aItIm.More(); aItIm.Next()) {
TopoDS_Shape aSXIm=aItIm.Value();
aSXIm.Orientation(aOrX);
aBB.Add(aCIm, aSXIm);
TopoDS_Shape aSXIm=aItIm.Value();
aSXIm.Orientation(aOrX);
aBB.Add(aCIm, aSXIm);
}
}
else {

View File

@@ -264,7 +264,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
BOPCol_MapOfShape aMFence;
Handle(NCollection_BaseAllocator) aAllocator;
BOPCol_ListOfShape aLFIm(myAllocator);
BOPCol_MapIteratorOfMapOfShape aItMS;
BOPAlgo_VectorOfBuilderFace aVBF;
//
myErrorStatus=0;
@@ -866,27 +865,27 @@ Standard_Boolean HasPaveBlocksOnIn(const BOPDS_FaceInfo& aFI1,
const BOPDS_FaceInfo& aFI2)
{
Standard_Boolean bRet;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
Standard_Integer i, aNbPB;
//
bRet=Standard_False;
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.PaveBlocksIn();
//
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
aItMPB.Initialize(aMPBOn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.PaveBlocksOn();
aNbPB = aMPBOn2.Extent();
for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBOn2(i);
bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
if (bRet) {
return bRet;
}
}
//
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
aItMPB.Initialize(aMPBIn2);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.PaveBlocksIn();
aNbPB = aMPBIn2.Extent();
for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBIn2(i);
bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
if (bRet) {
return bRet;
}

View File

@@ -801,7 +801,6 @@ void BOPAlgo_Builder::BuildSplitSolids
Standard_Integer i, aNbS;
TopExp_Explorer aExp;
BOPCol_ListIteratorOfListOfShape aIt;
BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
//
Handle(NCollection_IncAllocator) aAlr0;
aAlr0=new NCollection_IncAllocator();
@@ -933,7 +932,6 @@ void BOPAlgo_Builder::FillInternalShapes()
TopAbs_State aState;
TopoDS_Iterator aItS;
BRep_Builder aBB;
BOPCol_MapIteratorOfMapOfShape aItM;
BOPCol_ListIteratorOfListOfShape aIt, aIt1;
//
Handle(NCollection_IncAllocator) aAllocator;
@@ -942,12 +940,13 @@ void BOPAlgo_Builder::FillInternalShapes()
//
BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
BOPCol_IndexedMapOfShape aMx(100, aAllocator);
BOPCol_MapOfShape aMSI(100, aAllocator);
BOPCol_IndexedMapOfShape aMSI(100, aAllocator);
BOPCol_MapOfShape aMFence(100, aAllocator);
BOPCol_MapOfShape aMSOr(100, aAllocator);
BOPCol_ListOfShape aLSd(aAllocator);
BOPCol_ListOfShape aLArgs(aAllocator);
BOPCol_ListOfShape aLSC(aAllocator);
BOPCol_ListOfShape aLSI(aAllocator);
//
// 1. Shapes to process
//
@@ -1066,20 +1065,23 @@ void BOPAlgo_Builder::FillInternalShapes()
//
// 3. Some shapes of aMSI can be already tied with faces of
// split solids
aItM.Initialize(aMSI);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aSI=aItM.Key();
aNbSI = aMSI.Extent();
for (i = 1; i <= aNbSI; ++i) {
const TopoDS_Shape& aSI = aMSI(i);
if (aMSx.Contains(aSI)) {
const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
aNbSx=aLSx.Extent();
if (aNbSx) {
aMSI.Remove(aSI);
aNbSx = aLSx.Extent();
if (!aNbSx) {
aLSI.Append(aSI);
}
}
else {
aLSI.Append(aSI);
}
}
//
// 4. Just check it
aNbSI=aMSI.Extent();
aNbSI = aLSI.Extent();
if (!aNbSI) {
return;
}
@@ -1090,49 +1092,52 @@ void BOPAlgo_Builder::FillInternalShapes()
for (; aIt.More(); aIt.Next()) {
TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
//
aItM.Initialize(aMSI);
for (; aItM.More(); aItM.Next()) {
TopoDS_Shape aSI=aItM.Key();
aIt1.Initialize(aLSI);
for (; aIt1.More();) {
TopoDS_Shape aSI = aIt1.Value();
aSI.Orientation(TopAbs_INTERNAL);
//
aState=BOPTools_AlgoTools::ComputeStateByOnePoint
(aSI, aSd, 1.e-11, myContext);
if (aState==TopAbs_IN) {
//
if (aState != TopAbs_IN) {
aIt1.Next();
continue;
}
//
if(aMSOr.Contains(aSd)) {
//
if(aMSOr.Contains(aSd)) {
//
TopoDS_Solid aSdx;
//
aBB.MakeSolid(aSdx);
aItS.Initialize(aSd);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aSh=aItS.Value();
aBB.Add(aSdx, aSh);
}
//
aBB.Add(aSdx, aSI);
//
if (myImages.IsBound(aSdx)) {
BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
aLS.Append(aSdx);
}
else {
BOPCol_ListOfShape aLS;
aLS.Append(aSdx);
myImages.Bind(aSd, aLS);
}
//
aMSOr.Remove(aSd);
aSd=aSdx;
TopoDS_Solid aSdx;
//
aBB.MakeSolid(aSdx);
aItS.Initialize(aSd);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aSh=aItS.Value();
aBB.Add(aSdx, aSh);
}
//
aBB.Add(aSdx, aSI);
//
if (myImages.IsBound(aSdx)) {
BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
aLS.Append(aSdx);
}
else {
aBB.Add(aSd, aSI);
BOPCol_ListOfShape aLS;
aLS.Append(aSdx);
myImages.Bind(aSd, aLS);
}
//
aMSI.Remove(aSI);
} //if (aState==TopAbs_IN) {
}// for (; aItM.More(); aItM.Next()) {
}//for (; aIt1.More(); aIt1.Next()) {
aMSOr.Remove(aSd);
aSd=aSdx;
}
else {
aBB.Add(aSd, aSI);
}
//
aLSI.Remove(aIt1);
}//for (; aIt1.More();) {
}//for (; aIt.More(); aIt.Next()) {
//
//-----------------------------------------------------scope t
aLArgs.Clear();

View File

@@ -244,7 +244,7 @@ void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
//
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
//
anExt = myBBox.SquareExtent() * 0.5;
anExt = sqrt(myBBox.SquareExtent()) * 0.5;
myBBox.Enlarge(anExt);
myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
//

View File

@@ -240,7 +240,7 @@ is
theF2: Face from TopoDS;
theTolR3D:Real from Standard;
theNC:out Curve from BOPDS;
theMVB:out MapOfInteger from BOPCol)
theLBV:out ListOfInteger from BOPCol)
is protected;
IsExistingPaveBlock(me:out;
@@ -367,9 +367,9 @@ is
ProcessExistingPaveBlocks(me:out;
theInt : Integer from Standard;
theMPBOnIn : IndexedMapOfPaveBlock from BOPDS;
theDMBV : DataMapOfIntegerListOfInteger from BOPCol;
theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMVI : out DataMapOfShapeInteger from BOPCol;
theMVB : MapOfInteger from BOPCol;
theMPB : out MapOfPaveBlock from BOPDS)
is protected;
---Purpose:
@@ -402,11 +402,12 @@ is
-- is closed 3D-curve
PreparePostTreatFF(me:out;
aInt : Integer from Standard;
aInt : Integer from Standard;
aCur : Integer from Standard;
aPB : PaveBlock from BOPDS;
aMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
aMVI : out DataMapOfShapeInteger from BOPCol;
aVC : out VectorOfCurve from BOPDS)
aLPB : out ListOfPaveBlock from BOPDS)
is protected;
---Purpose:
-- Keeps data for post treatment

View File

@@ -46,7 +46,6 @@
Standard_Boolean bWithSubShape;
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, k, aNbBlocks;
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
TopoDS_Vertex aVn;
BOPDS_ShapeInfo aSIn;

View File

@@ -737,8 +737,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices
BOPCol_IndexedMapOfShape aMVProcessed;
BOPCol_MapOfInteger aMFence;
BOPCol_ListIteratorOfListOfInteger aIt;
BOPCol_DataMapOfShapeListOfShape aDMVLV;
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItDMVLV;
BOPCol_IndexedDataMapOfShapeListOfShape aDMVLV;
//
BOPCol_BoxBndTreeSelector aSelector;
BOPCol_BoxBndTree aBBTree;
@@ -778,7 +777,6 @@ void BOPAlgo_PaveFiller::TreatNewVertices
//
Standard_Integer aIP, aNbIP1, aIP1;
BOPCol_ListOfShape aLVSD;
BOPCol_MapIteratorOfMapOfInteger aItMI;
BOPCol_ListOfInteger aLIP, aLIP1, aLIPC;
BOPCol_ListIteratorOfListOfInteger aItLIP;
//
@@ -823,14 +821,14 @@ void BOPAlgo_PaveFiller::TreatNewVertices
aLVSD.Append(aVP);
}
aVF=aLVSD.First();
aDMVLV.Bind(aVF, aLVSD);
aDMVLV.Add(aVF, aLVSD);
}// for (i=1; i<=aNbV; ++i) {
// Make new vertices
aItDMVLV.Initialize(aDMVLV);
for(; aItDMVLV.More(); aItDMVLV.Next()) {
const TopoDS_Shape& aV=aItDMVLV.Key();
const BOPCol_ListOfShape& aLVSD=aItDMVLV.Value();
aNbV = aDMVLV.Extent();
for (i = 1; i <= aNbV; ++i) {
const TopoDS_Shape& aV = aDMVLV.FindKey(i);
const BOPCol_ListOfShape& aLVSD = aDMVLV(i);
if (aLVSD.IsEmpty()) {
myImages.Add(aV, aLVSD);
}

View File

@@ -65,8 +65,6 @@
#include <BOPCol_MapOfInteger.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPCol_DataMapOfIntegerReal.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
@@ -374,10 +372,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
//-----------------------------------------------------scope f
aAllocator=new NCollection_IncAllocator();
//
BOPCol_ListOfInteger aLSE(aAllocator);
BOPCol_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator),
aMVStick(100,aAllocator), aMVEF(100, aAllocator),
aMVB(100, aAllocator), aMI(100, aAllocator);
aMI(100, aAllocator);
BOPDS_IndexedMapOfPaveBlock aMPBOnIn(100, aAllocator);
BOPDS_MapOfPaveBlock aMPBAdd(100, aAllocator);
BOPDS_ListOfPaveBlock aLPB(aAllocator);
@@ -385,8 +383,9 @@ void BOPAlgo_PaveFiller::MakeBlocks()
BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator);
BOPDS_DataMapOfPaveBlockListOfPaveBlock aDMExEdges(100, aAllocator);
BOPCol_DataMapOfIntegerReal aMVTol(100, aAllocator);
BOPCol_DataMapIteratorOfDataMapOfIntegerReal aItMV;
BOPCol_DataMapOfIntegerInteger aDMI(100, aAllocator);
BOPCol_DataMapOfIntegerListOfInteger aDMBV(100, aAllocator);
BOPCol_DataMapIteratorOfDataMapOfIntegerReal aItMV;
//
for (i=0; i<aNbFF; ++i) {
//
@@ -411,17 +410,19 @@ void BOPAlgo_PaveFiller::MakeBlocks()
// Update face info
if (aMF.Add(nF1)) {
myDS->UpdateFaceInfoOn(nF1);
myDS->UpdateFaceInfoIn(nF1);
}
if (aMF.Add(nF2)) {
myDS->UpdateFaceInfoOn(nF2);
myDS->UpdateFaceInfoIn(nF2);
}
//
BOPDS_FaceInfo& aFI1=myDS->ChangeFaceInfo(nF1);
BOPDS_FaceInfo& aFI2=myDS->ChangeFaceInfo(nF2);
//
aMVOnIn.Clear();
aMPBOnIn.Clear();
aMVB.Clear();
aDMBV.Clear();
aMVTol.Clear();
//
myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn);
@@ -465,7 +466,13 @@ void BOPAlgo_PaveFiller::MakeBlocks()
}
//
if (aIC.HasBounds()) {
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aMVB);
aLBV.Clear();
//
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aLBV);
//
if (!aLBV.IsEmpty()) {
aDMBV.Bind(j, aLBV);
}
}
}//for (j=0; j<aNbC; ++j) {
//
@@ -529,7 +536,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
aFI2.PaveBlocksIn().Contains(aPBOut));
}
if (!bInBothFaces) {
PreparePostTreatFF(i, aPBOut, aMSCPB, aMVI, aVC);
PreparePostTreatFF(i, j, aPBOut, aMSCPB, aMVI, aLPBC);
}
}
continue;
@@ -580,7 +587,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
TV->Tolerance(aTol);
}
//
ProcessExistingPaveBlocks(i, aMPBOnIn, aMSCPB, aMVI, aMVB, aMPBAdd);
ProcessExistingPaveBlocks(i, aMPBOnIn, aDMBV, aMSCPB, aMVI, aMPBAdd);
}//for (i=0; i<aNbFF; ++i) {
//
// post treatment
@@ -913,22 +920,23 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
for (j=0; j<aNbC; ++j) {
BOPDS_Curve& aNC=aVNC(j);
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
aItLPB.Initialize(aLPBC);
//
// Treat existing pave blocks
if (aItLPB.More() && theDME.IsBound(aLPBC.First())) {
const Handle(BOPDS_PaveBlock)& aPB=aLPBC.First();
BOPDS_ListOfPaveBlock& aLPB=theDME.ChangeFind(aPB);
UpdateExistingPaveBlocks(aPB, aLPB, nF1, nF2);
aLPBC.Clear();
continue;
}
//
// Add section edges to face info
for (; aItLPB.More(); aItLPB.Next()) {
aItLPB.Initialize(aLPBC);
for (; aItLPB.More(); ) {
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
//
// Treat existing pave blocks
if (theDME.IsBound(aPB)) {
BOPDS_ListOfPaveBlock& aLPB=theDME.ChangeFind(aPB);
UpdateExistingPaveBlocks(aPB, aLPB, nF1, nF2);
aLPBC.Remove(aItLPB);
continue;
}
//
aFI1.ChangePaveBlocksSc().Add(aPB);
aFI2.ChangePaveBlocksSc().Add(aPB);
aItLPB.Next();
}
}
//
@@ -1006,6 +1014,11 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
const Handle(BOPDS_PaveBlock)& aPB = aMPBCopy(j);
if (theDME.IsBound(aPB)) {
const BOPDS_ListOfPaveBlock& aLPB = theDME.Find(aPB);
if (aLPB.IsEmpty()) {
aMPBOnIn.Add(aPB);
continue;
}
//
aItLPB.Initialize(aLPB);
for (; aItLPB.More(); aItLPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB1 = aItLPB.Value();
@@ -1189,7 +1202,7 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
const TopoDS_Face& aF2,
const Standard_Real aTolR3D,
BOPDS_Curve& aNC,
BOPCol_MapOfInteger& aMVB)
BOPCol_ListOfInteger& aLVB)
{
Standard_Boolean bVF;
Standard_Integer nV, iFlag, nVn, j, aNbEP;
@@ -1277,7 +1290,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVn);
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
BRepBndLib::Add(aVn, aBoxDS);
aMVB.Add(nVn);
//
aLVB.Append(nVn);
}
}
}
@@ -1724,41 +1738,70 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
const Standard_Integer iCheckExtend)
{
Standard_Boolean bIsVertexOnLine;
Standard_Real aT, aTol, aTolNew;
BOPDS_Pave aPave;
Standard_Real aT, aTolV;
//
const TopoDS_Vertex aV = (*(TopoDS_Vertex *)(&myDS->Shape(nV)));
const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&myDS->Shape(nV)));
Handle(BOPDS_PaveBlock)& aPB=aNC.ChangePaveBlock1();
const IntTools_Curve& aIC = aNC.Curve();
//
bIsVertexOnLine=myContext->IsVertexOnLine(aV, aIC, aTolR3D, aT);
if (!bIsVertexOnLine && iCheckExtend) {
aTol = BRep_Tool::Tolerance(aV);
aTolV = BRep_Tool::Tolerance(aV);
//
ExtendedTolerance(nV, aMI, aTol, iCheckExtend);
bIsVertexOnLine=myContext->IsVertexOnLine(aV, aTol, aIC, aTolR3D, aT);
ExtendedTolerance(nV, aMI, aTolV, iCheckExtend);
bIsVertexOnLine=myContext->IsVertexOnLine(aV, aTolV, aIC, aTolR3D, aT);
}
//
if (bIsVertexOnLine) {
aPave.SetIndex(nV);
aPave.SetParameter(aT);
// check if aPB contains the parameter aT
Standard_Boolean bExist;
Standard_Integer nVToUpdate;
Standard_Real aPTol, aDist, aTolVNew, aTolV2, aDTol;
TopoDS_Vertex aVToUpdate;
gp_Pnt aP1, aP2;
//
aPB->AppendExtPave(aPave);
aTolV2 = 0.;
aDTol = 1.e-12;
//
aTol = BRep_Tool::Tolerance(aV);
GeomAdaptor_Curve aGAC(aIC.Curve());
aPTol = aGAC.Resolution(aTolR3D);
//
BOPTools_AlgoTools::UpdateVertex (aIC, aT, aV);
//
if (!aMVTol.IsBound(nV)) {
aTolNew = BRep_Tool::Tolerance(aV);
if (aTolNew > aTol) {
aMVTol.Bind(nV, aTol);
}
bExist = aPB->ContainsParameter(aT, aPTol, nVToUpdate);
if (bExist) {
// use existing pave
aP1 = BRep_Tool::Pnt(aV);
aTolV2 = BRep_Tool::Tolerance(aV);
aVToUpdate = (*(TopoDS_Vertex *)(&myDS->Shape(nVToUpdate)));
}
else {
// add new pave
BOPDS_Pave aPave;
aPave.SetIndex(nV);
aPave.SetParameter(aT);
aPB->AppendExtPave(aPave);
//
aP1 = aGAC.Value(aT);
nVToUpdate = nV;
aVToUpdate = aV;
}
//
aTolV = BRep_Tool::Tolerance(aVToUpdate);
aP2 = BRep_Tool::Pnt(aVToUpdate);
aDist = aP1.Distance(aP2);
aTolVNew = aDist - aTolV2;
//
if (aTolVNew > aTolV) {
BRep_Builder aBB;
aBB.UpdateVertex(aVToUpdate, aTolVNew+aDTol);
//
if (!aMVTol.IsBound(nVToUpdate)) {
aMVTol.Bind(nVToUpdate, aTolV);
}
//
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVToUpdate);
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
BRepBndLib::Add(aVToUpdate, aBoxDS);
}
//
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV);
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
BRepBndLib::Add(aV, aBoxDS);
}
}
@@ -1769,51 +1812,68 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
(const Standard_Integer theInt,
const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
const BOPCol_DataMapOfIntegerListOfInteger& aDMBV,
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
const BOPCol_MapOfInteger& aMVB,
BOPDS_MapOfPaveBlock& aMPB)
{
Standard_Integer nV, nE, iFlag, i, aNbPB;
Standard_Real aT;
BOPCol_MapIteratorOfMapOfInteger aItB;
if (aDMBV.IsEmpty()) {
return;
}
//
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
Standard_Real aT;
Standard_Integer i, nV, nE, iC, aNbPB, iFlag;
BOPCol_ListIteratorOfListOfInteger aItLI;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItBV;
//
BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
BOPDS_InterfFF& aFF = aFFs(theInt);
BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves();
//
aItB.Initialize(aMVB);
for (; aItB.More(); aItB.Next()) {
nV = aItB.Value();
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
const Bnd_Box& aBoxV=aSIV.Box();
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape();
if (!aMVI.IsBound(aV)) {
continue;
}
BOPDS_VectorOfCurve& aVC = aFF.ChangeCurves();
//
aNbPB = aMPBOnIn.Extent();
//
aItBV.Initialize(aDMBV);
for (; aItBV.More(); aItBV.Next()) {
iC = aItBV.Key();
const BOPCol_ListOfInteger& aLBV = aItBV.Value();
//
aNbPB = aMPBOnIn.Extent();
for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
BOPDS_Curve& aNC = aVC.ChangeValue(iC);
BOPDS_ListOfPaveBlock& aLPBC = aNC.ChangePaveBlocks();
//
aItLI.Initialize(aLBV);
for (; aItLI.More(); aItLI.Next()) {
nV = aItLI.Value();
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
const Bnd_Box& aBoxV=aSIV.Box();
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape();
if (!aMVI.IsBound(aV)) {
continue;
}
//
if (aMPB.Contains(aPB)) {
continue;
}
nE=aPB->Edge();
const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
const Bnd_Box& aBoxE=aSIE.Box();
//
if (!aBoxV.IsOut(aBoxE)) {
for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
continue;
}
//
if (aMPB.Contains(aPB)) {
continue;
}
//
nE = aPB->Edge();
const BOPDS_ShapeInfo& aSIE = myDS->ShapeInfo(nE);
const Bnd_Box& aBoxE = aSIE.Box();
//
if (aBoxV.IsOut(aBoxE)) {
continue;
}
//
const TopoDS_Edge& aE = *(TopoDS_Edge*)&aSIE.Shape();
//
iFlag=myContext->ComputeVE (aV, aE, aT);
iFlag = myContext->ComputeVE(aV, aE, aT);
if (!iFlag) {
aMPB.Add(aPB);
//
PreparePostTreatFF(theInt, aPB, aMSCPB, aMVI, aVC);
PreparePostTreatFF(theInt, iC, aPB, aMSCPB, aMVI, aLPBC);
}
}
}
@@ -1888,10 +1948,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
// 3. Update pave blocks
if (bCB) {
//create new common blocks
BOPDS_ListOfPaveBlock aLPBNew;
const BOPCol_ListOfInteger& aFaces = aCB1->Faces();
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
Handle(BOPDS_PaveBlock)& aPB = aIt.ChangeValue();
const Handle(BOPDS_PaveBlock)& aPB = aIt.Value();
//
aCB = new BOPDS_CommonBlock;
aIt1.Initialize(aLPB1);
@@ -1911,8 +1972,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
aCB->AddFaces(aFaces);
myDS->SortPaveBlocks(aCB);
//
aPB=aCB->PaveBlocks().First();
const Handle(BOPDS_PaveBlock)& aPBNew = aCB->PaveBlocks().First();
aLPBNew.Append(aPBNew);
}
//
aLPB = aLPBNew;
}
else {
nE = aPBf->OriginalEdge();
@@ -2038,16 +2102,14 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
//=======================================================================
void BOPAlgo_PaveFiller::PreparePostTreatFF
(const Standard_Integer aInt,
const Standard_Integer aCur,
const Handle(BOPDS_PaveBlock)& aPB,
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI,
BOPDS_VectorOfCurve& aVC)
BOPDS_ListOfPaveBlock& aLPBC)
{
Standard_Integer nV1, nV2, iC;
Standard_Integer nV1, nV2;
//
aVC.Append1();
iC=aVC.Extent()-1;
BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks();
aLPBC.Append(aPB);
//
aPB->Indices(nV1, nV2);
@@ -2057,7 +2119,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
// Keep info for post treatment
BOPDS_CoupleOfPaveBlocks aCPB;
aCPB.SetIndexInterf(aInt);
aCPB.SetIndex(iC);
aCPB.SetIndex(aCur);
aCPB.SetPaveBlock1(aPB);
//
aMSCPB.Add(aE, aCPB);
@@ -2159,7 +2221,7 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks
}
//
if (bRebuild) {
nSp = SplitEdge(aPB->Edge(), nV[0], aT[0], nV[1], aT[1]);
nSp = SplitEdge(aPB->OriginalEdge(), nV[0], aT[0], nV[1], aT[1]);
if (bCB) {
aCB->SetEdge(nSp);
}

View File

@@ -17,29 +17,9 @@
#include <BOPAlgo_PaveFiller.ixx>
#include <NCollection_IncAllocator.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <BRepBndLib.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_Curve.hxx>
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_SectionAttribute.hxx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_NCVector.hxx>
#include <BOPCol_Parallel.hxx>
#include <BOPCol_MapOfShape.hxx>
@@ -63,6 +43,16 @@
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BRep_Builder.hxx>
#include <BRepBndLib.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
static
Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF);
@@ -472,8 +462,8 @@ void BOPAlgo_PaveFiller::MakePCurves()
{
Standard_Boolean bHasPC;
Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI, nEx;
Standard_Integer j, aNbPBIn, aNbPBOn;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
TopoDS_Face aF1F, aF2F;
BOPAlgo_VectorOfMPC aVMPC;
//
@@ -491,9 +481,9 @@ void BOPAlgo_PaveFiller::MakePCurves()
aF1F.Orientation(TopAbs_FORWARD);
// In
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
aItMPB.Initialize(aMPBIn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPBIn = aMPBIn.Extent();
for (j = 1; j <= aNbPBIn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
nE=aPB->Edge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
//
@@ -505,9 +495,9 @@ void BOPAlgo_PaveFiller::MakePCurves()
//
// On
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
aItMPB.Initialize(aMPBOn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPBOn = aMPBOn.Extent();
for (j = 1; j <= aNbPBOn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(j);
nE=aPB->Edge();
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
bHasPC=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF1F);
@@ -715,10 +705,9 @@ void BOPAlgo_PaveFiller::Prepare()
TopAbs_FACE
};
Standard_Boolean bJustAdd, bIsBasedOnPlane;
Standard_Integer i, aNb, n1, nF;
Standard_Integer i, aNb, n1, nF, aNbF;
TopExp_Explorer aExp;
BOPCol_MapOfShape aMF;
BOPCol_MapIteratorOfMapOfShape aItMF;
BOPCol_IndexedMapOfShape aMF;
//
myErrorStatus=0;
//
@@ -736,15 +725,15 @@ void BOPAlgo_PaveFiller::Prepare()
}
}
//
if (aMF.IsEmpty()) {
aNbF = aMF.Extent();
if (!aNbF) {
return;
}
//
BOPAlgo_VectorOfBPC aVBPC;
//
aItMF.Initialize(aMF);
for (; aItMF.More(); aItMF.Next()) {
const TopoDS_Face& aF=*((TopoDS_Face *)&aItMF.Key());
for (i = 1; i <= aNbF; ++i) {
const TopoDS_Face& aF = *(TopoDS_Face*)&aMF(i);
aExp.Init(aF, aType[1]);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=*((TopoDS_Edge *)&aExp.Current());

View File

@@ -142,15 +142,14 @@ static
const Standard_Integer nF,
BOPDS_ListOfPaveBlock& aLPBOut)
{
Standard_Integer nV1, nV2;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
Standard_Integer i, aNbPBOn, aNbPBIn, aNbPBSc, nV1, nV2;
//
const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
// In
const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
aItMPB.Initialize(aMPBIn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPBIn = aMPBIn.Extent();
for (i = 1; i <= aNbPBIn; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
@@ -158,9 +157,9 @@ static
}
// On
const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
aItMPB.Initialize(aMPBOn);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPBOn = aMPBOn.Extent();
for (i = 1; i <= aNbPBOn; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
@@ -168,9 +167,9 @@ static
}
// Sections
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
aItMPB.Initialize(aMPBSc);
for(; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPBSc = aMPBSc.Extent();
for (i = 1; i <= aNbPBSc; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
aPB->Indices(nV1, nV2);
if (nV==nV1 || nV==nV2) {
aLPBOut.Append(aPB);
@@ -244,7 +243,7 @@ static
const Handle(BOPDS_PaveBlock)& aPBD)
{
Standard_Boolean bXDir, bIsDone;
Standard_Integer nE, aNbPoints, j;
Standard_Integer nE, aNbPoints, j, anInd;
Standard_Real aTD1, aTD2, aT1, aT2, aTolInter, aX, aDT;
Standard_Real aTolCmp;
gp_Pnt2d aP2d1, aP2d2, aP2D;
@@ -329,7 +328,7 @@ static
continue;
}
//
if (aPBD->ContainsParameter(aX, aDT)) {
if (aPBD->ContainsParameter(aX, aDT, anInd)) {
continue;
}
aPave.SetParameter(aX);

View File

@@ -43,7 +43,8 @@ static
TopoDS_Shell& );
//
static
void RefineShell(TopoDS_Shell& theShell);
void RefineShell(TopoDS_Shell& theShell,
BOPCol_ListOfShape& aLShX);
//
static
void MapEdgesAndFaces
@@ -329,8 +330,9 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
BOPTools_CoupleOfShape aCSOff;
BOPCol_MapOfOrientedShape AddedFacesMap;
BOPCol_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
Handle (IntTools_Context) aContext;
//
Handle (IntTools_Context) aContext=new IntTools_Context;
aContext=new IntTools_Context;
//
const BOPCol_ListOfShape& myShapes=aCB.Shapes();
//
@@ -454,15 +456,18 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
if (BRep_Tool::IsClosed(aShell)) {
aShell.Closed (Standard_True);
myLoops.Append(aShell);
}
else {
RefineShell(aShell);
if (BRep_Tool::IsClosed(aShell)) {
aShell.Closed (Standard_True);
myLoops.Append(aShell);
BOPCol_ListOfShape aLShX;
BOPCol_ListIteratorOfListOfShape aItLShX;
//
RefineShell(aShell, aLShX);
//
aItLShX.Initialize(aLShX);
for (; aItLShX.More(); aItLShX.Next()) {
TopoDS_Shell& aShX=*((TopoDS_Shell*)&aItLShX.Value());
//
if (BRep_Tool::IsClosed(aShX)) {
aShX.Closed(Standard_True);
myLoops.Append(aShX);
}
}
} // for (; aItF.More(); aItF.Next()) {
@@ -471,7 +476,8 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
//function : RefineShell
//purpose :
//=======================================================================
void RefineShell(TopoDS_Shell& theShell)
void RefineShell(TopoDS_Shell& theShell,
BOPCol_ListOfShape& aLShX)
{
TopoDS_Iterator aIt;
//
@@ -480,12 +486,12 @@ void RefineShell(TopoDS_Shell& theShell)
return;
}
//
Standard_Integer i, aNbMEF, aNbF;
Standard_Integer i, aNbMEF, aNbF, aNbMFB;
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
TopoDS_Builder aBB;
TopExp_Explorer aExp;
BOPCol_MapOfShape aMEStop, aMFB;
BOPCol_MapIteratorOfMapOfShape aItM;
BOPCol_IndexedMapOfShape aMFB;
BOPCol_MapOfShape aMEStop, aMFProcessed;
BOPCol_ListIteratorOfListOfShape aItLF, aItLFP;
BOPCol_ListOfShape aLFP, aLFP1;
//
@@ -494,6 +500,7 @@ void RefineShell(TopoDS_Shell& theShell)
TopAbs_EDGE,
TopAbs_FACE,
aMEF);
//
aNbMEF=aMEF.Extent();
for (i=1; i<=aNbMEF; ++i) {
const TopoDS_Shape& aE=aMEF.FindKey(i);
@@ -505,68 +512,89 @@ void RefineShell(TopoDS_Shell& theShell)
}
//
if (aMEStop.IsEmpty()) {
aLShX.Append(theShell);
return;
}
//
// The first Face
const TopoDS_Shape& aF1=aIt.Value();
aMFB.Add(aF1);
aLFP.Append(aF1);
//
// Trying to reach the branch point
for (;;) {
aItLFP.Initialize(aLFP);
for (; aItLFP.More(); aItLFP.Next()) {
const TopoDS_Shape& aFP=aItLFP.Value();
//
aExp.Init(aFP, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
if (aMEStop.Contains(aE)) {
continue;
}
//
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE);
//
aItLF.Initialize(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Shape& aFP1=aItLF.Value();
if (aFP1.IsSame(aFP)) {
continue;
}
if (aMFB.Contains(aFP1)) {
continue;
}
aMFB.Add(aFP1);
aLFP1.Append(aFP1);
}// for (; aItLF.More(); aItLF.Next()) {
}// for (; aExp.More(); aExp.Next()) {
}// for (; aItLFP.More(); aItLFP.Next()) {
//
//
if (aLFP1.IsEmpty()) {
break;
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF1=aIt.Value();
if (!aMFProcessed.Add(aF1)) {
continue;
}
//
aMFB.Clear();
aLFP.Clear();
aItLF.Initialize(aLFP1);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Shape& aFP1=aItLF.Value();
aLFP.Append(aFP1);
//
aMFB.Add(aF1);
aLFP.Append(aF1);
//
// Trying to reach the branch point
for (;;) {
aItLFP.Initialize(aLFP);
for (; aItLFP.More(); aItLFP.Next()) {
const TopoDS_Shape& aFP=aItLFP.Value();
//
aExp.Init(aFP, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
if (aMEStop.Contains(aE)) {
continue;
}
//
if (aE.Orientation() == TopAbs_INTERNAL) {
continue;
}
//
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE);
//
aItLF.Initialize(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Shape& aFP1=aItLF.Value();
if (aFP1.IsSame(aFP)) {
continue;
}
if (aMFB.Contains(aFP1)) {
continue;
}
//
aMFProcessed.Add(aFP1);
aMFB.Add(aFP1);
aLFP1.Append(aFP1);
}// for (; aItLF.More(); aItLF.Next()) {
}// for (; aExp.More(); aExp.Next()) {
} // for (; aItLFP.More(); aItLFP.Next()) {
//
//
if (aLFP1.IsEmpty()) {
break;
}
//
aLFP.Clear();
aItLF.Initialize(aLFP1);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Shape& aFP1=aItLF.Value();
aLFP.Append(aFP1);
}
aLFP1.Clear();
}// for (;;) {
//
aNbMFB=aMFB.Extent();
if (aNbMFB) {
TopoDS_Shell aShX;
aBB.MakeShell(aShX);
//
for (i=1; i<=aNbMFB; ++i) {
const TopoDS_Shape& aFB=aMFB(i);
aBB.Add(aShX, aFB);
}
aLShX.Append(aShX);
}
aLFP1.Clear();
}// for (;;) {
//
// Remove all faces before the branch point
aItM.Initialize(aMFB);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFB=aItM.Value();
aBB.Remove(theShell, aFB);
}
}//for (; aIt.More(); aIt.Next()) {
}
//=======================================================================
//function : MakeShells

View File

@@ -120,7 +120,6 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks()
TopoDS_Iterator aItE;
TopoDS_Shape aER;
BOPCol_ListIteratorOfListOfShape aIt;
BOPCol_MapIteratorOfMapOfShape aItM;
//
BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator);
BOPCol_IndexedMapOfShape aMVP(100, myAllocator);
@@ -184,7 +183,7 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks()
}
}
}
}//for (; aItM.More(); aItM.Next()) {
}//for (k=1; k<=aNbVP; ++k) {
//
aNbVP=aMVAdd.Extent();
if (!aNbVP) {

View File

@@ -13,6 +13,7 @@
// commercial license or contractual agreement.
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Edge.hxx>
@@ -85,7 +86,7 @@ typedef NCollection_IndexedDataMap<TopoDS_Shape, \
//purpose :
//=======================================================================
inline void BOPAlgo_WireSplitter::MakeWire(BOPCol_ListOfShape& aLE,
TopoDS_Wire& aWire)
TopoDS_Wire& aWire)
{
BRep_Builder aBB;
aBB.MakeWire(aWire);
@@ -94,4 +95,5 @@ typedef NCollection_IndexedDataMap<TopoDS_Shape, \
for (; aIt.More(); aIt.Next()){
aBB.Add(aWire, aIt.Value());
}
aWire.Closed(BRep_Tool::IsClosed(aWire));
}

View File

@@ -14,15 +14,19 @@
#include <BOPAlgo_WireSplitter.ixx>
#include <Precision.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Dir2d.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <BOPAlgo_WireEdgeSet.hxx>
#include <BOPAlgo_WireSplitter.hxx>
#include <BOPCol_IndexedDataMapOfShapeInteger.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_SequenceOfPnt2d.hxx>
#include <BOPCol_SequenceOfReal.hxx>
#include <BOPCol_SequenceOfShape.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <GeomAdaptor_Surface.hxx>
@@ -42,9 +46,6 @@
#include <BRep_Builder.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BOPCol_ListOfShape.hxx>
@@ -848,8 +849,7 @@ void RefineAngles(const TopoDS_Face& myFace,
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap)
{
Standard_Integer aNb, i;
BOPCol_DataMapOfShapeInteger aMSI;
BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItMSI;
BOPCol_IndexedDataMapOfShapeInteger aMSI;
BOPCol_MapOfShape aMBE;
BOPCol_ListIteratorOfListOfShape aIt;
//
@@ -857,32 +857,29 @@ void RefineAngles(const TopoDS_Face& myFace,
aIt.Initialize(myEdges);
for(; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if(aMSI.IsBound(aE)) {
Standard_Integer& iCnt=aMSI.ChangeFind(aE);
if(aMSI.Contains(aE)) {
Standard_Integer& iCnt = aMSI.ChangeFromKey(aE);
++iCnt;
}
else {
Standard_Integer iCnt=1;
aMSI.Bind(aE, iCnt);
Standard_Integer iCnt = 1;
aMSI.Add(aE, iCnt);
}
}
//
aItMSI.Initialize(aMSI);
for(; aItMSI.More(); aItMSI.Next()) {
Standard_Integer iCnt;
//
const TopoDS_Shape& aE=aItMSI.Key();
iCnt=aItMSI.Value();
if (iCnt==1) {
aNb = aMSI.Extent();
for (i = 1; i <= aNb; ++i) {
Standard_Integer iCnt = aMSI(i);
if (iCnt == 1) {
const TopoDS_Shape& aE = aMSI.FindKey(i);
aMBE.Add(aE);
}
}
//
aMSI.Clear();
//
aNb=mySmartMap.Extent();
for (i=1; i<=aNb; ++i) {
aNb = mySmartMap.Extent();
for (i = 1; i <= aNb; ++i) {
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&mySmartMap.FindKey(i));
BOPAlgo_ListOfEdgeInfo& aLEI=mySmartMap(i);
//

View File

@@ -49,6 +49,7 @@ is
imported DataMapOfIntegerListOfShape from BOPCol;
imported IndexedDataMapOfIntegerListOfInteger from BOPCol;
imported IndexedDataMapOfShapeInteger from BOPCol;
imported IndexedDataMapOfShapeShape;
imported IndexedMapOfOrientedShape;
end BOPCol;

View File

@@ -1,5 +1,5 @@
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2015 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -12,29 +12,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef math_Memory_HeaderFile
#define math_Memory_HeaderFile
#ifndef BOPCol_IndexedDataMapOfShapeShape_HeaderFile
#define BOPCol_IndexedDataMapOfShapeShape_HeaderFile
#include <string.h>
#include <TopoDS_Shape.hxx>
#include <TopTools_ShapeMapHasher.hxx>
// uniquement parce que memmove n'existe pas sur SUN
#ifndef WNT
void *reverse_move(void *s1, void *s2, int size);
#include <NCollection_IndexedDataMap.hxx>
inline void *memmove(void *s1, void *s2, int size) {
typedef NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> BOPCol_IndexedDataMapOfShapeShape;
/*
void *result;
if(s2 < s1) {
result = reverse_move(s1, s2, size);
}
else {
result = memcpy(s1, s2, size);
}
return result;
*/
return memcpy(s1, s2, size);
}
#endif
#endif

View File

@@ -1,6 +1,5 @@
// Created on: 2014-12-18
// Created by: Kirill Gavrilov
// Copyright (c) 2014 OPEN CASCADE SAS
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2015 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -13,12 +12,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _OpenGl_SequenceOfStructure
#define _OpenGl_SequenceOfStructure
#ifndef BOPCol_IndexedMapOfOrientedShape_HeaderFile
#define BOPCol_IndexedMapOfOrientedShape_HeaderFile
#include <NCollection_Sequence.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
class OpenGl_Structure;
typedef NCollection_Sequence<const OpenGl_Structure*> OpenGl_SequenceOfStructure;
#include <NCollection_IndexedMap.hxx>
#endif // _OpenGl_SequenceOfStructure
typedef NCollection_IndexedMap<TopoDS_Shape, TopTools_OrientedShapeMapHasher> BOPCol_IndexedMapOfOrientedShape;
#endif

View File

@@ -19,6 +19,8 @@ BOPCol_DataMapOfShapeListOfShape.hxx
BOPCol_MapOfOrientedShape.hxx
BOPCol_IndexedDataMapOfShapeListOfShape.hxx
BOPCol_IndexedMapOfShape.hxx
BOPCol_IndexedDataMapOfShapeShape.hxx
BOPCol_IndexedMapOfOrientedShape.hxx
BOPCol_ListOfListOfShape.hxx
BOPCol_SequenceOfShape.hxx
BOPCol_SequenceOfPnt2d.hxx

View File

@@ -1363,7 +1363,7 @@ void BOPDS_DS::FaceInfoIn(const Standard_Integer theF,
if (aSx.ShapeType()==TopAbs_VERTEX){
nV=Index(aSx);
if (HasShapeSD(nV, nVSD)) {
nV=nVSD;
nV=nVSD;
}
theMI.Add(nV);
}
@@ -1446,20 +1446,19 @@ void BOPDS_DS::AloneVertices(const Standard_Integer theI,
{
if (HasFaceInfo(theI)) {
//
Standard_Integer i, nV1, nV2, nV;
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
Standard_Integer i, j, nV1, nV2, nV, aNbPB;
BOPCol_MapIteratorOfMapOfInteger aItMI;
//
BOPCol_MapOfInteger aMI(100, myAllocator);
//
const BOPDS_FaceInfo& aFI=FaceInfo(theI);
//
for (i=0; i<2; ++i) {
for (i = 0; i < 2; ++i) {
const BOPDS_IndexedMapOfPaveBlock& aMPB=
(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
aItMPB.Initialize(aMPB);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
aNbPB = aMPB.Extent();
for (j = 1; j <= aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB = aMPB(j);
aPB->Indices(nV1, nV2);
aMI.Add(nV1);
aMI.Add(nV2);

View File

@@ -37,7 +37,6 @@
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_DataMapOfIntegerInteger.hxx>
#include <BOPCol_DataMapOfIntegerListOfInteger.hxx>
#include <BOPCol_IndexedMapOfInteger.hxx>
#include <BOPDS_ShapeInfo.hxx>
#include <BOPCol_ListOfInteger.hxx>
#include <BOPCol_IndexedMapOfInteger.hxx>
@@ -93,7 +92,6 @@ void BOPDS_IteratorSI::Intersect()
TopAbs_ShapeEnum aTi, aTj;
Handle(NCollection_IncAllocator) aAllocator;
BOPCol_ListIteratorOfListOfInteger aIt;
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
//
//-----------------------------------------------------scope_1 f
aAllocator=new NCollection_IncAllocator();
@@ -124,10 +122,10 @@ void BOPDS_IteratorSI::Intersect()
const BOPCol_ListOfInteger& aLA=aSI.SubShapes();
aIt.Initialize(aLA);
for (; aIt.More(); aIt.Next()) {
iX=aIt.Value();
aPKXB.Clear();
aPKXB.SetIds(i, iX);
aMPA.Add(aPKXB);
iX=aIt.Value();
aPKXB.Clear();
aPKXB.SetIds(i, iX);
aMPA.Add(aPKXB);
}
}
//

View File

@@ -186,13 +186,15 @@ is
ContainsParameter(me;
thePrm:Real from Standard;
theTol:Real from Standard)
theTol:Real from Standard;
theInd: in out Integer from Standard)
returns Boolean from Standard;
---Purpose:
--- Query
--- Returns true if the extra paves contain the pave
--- with given value of the parameter <thePrm>
--- <theTol> - the value of the tolerance to compare
--- <theInd> - index of the found pave
--
-- shrunk data

View File

@@ -234,21 +234,19 @@
//purpose :
//=======================================================================
Standard_Boolean BOPDS_PaveBlock::ContainsParameter(const Standard_Real theT,
const Standard_Real theTol)const
const Standard_Real theTol,
Standard_Integer& theInd) const
{
Standard_Boolean bRet;
Standard_Real dT;
BOPDS_ListIteratorOfListOfPave aIt;
//
bRet=Standard_False;
bRet = Standard_False;
aIt.Initialize(myExtPaves);
for (; aIt.More(); aIt.Next()) {
dT=aIt.Value().Parameter()-theT;
if (dT<0.) {
dT=-dT;
}
if (dT<theTol) {
bRet=!bRet;
const BOPDS_Pave& aPave = aIt.Value();
bRet = (Abs(aPave.Parameter() - theT) < theTol);
if (bRet) {
theInd = aPave.Index();
break;
}
}

View File

@@ -41,6 +41,8 @@ is
PartitionCommands (aDI:out Interpretor from Draw);
APICommands (aDI:out Interpretor from Draw);
OptionCommands (aDI:out Interpretor from Draw);
HistoryCommands (aDI:out Interpretor from Draw);
Factory (aDI:out Interpretor from Draw);
end BOPTest;

View File

@@ -38,8 +38,9 @@ void BOPTest::AllCommands(Draw_Interpretor& theCommands)
BOPTest::TolerCommands (theCommands);
BOPTest::ObjCommands (theCommands);
BOPTest::PartitionCommands (theCommands);
BOPTest::APICommands (theCommands);
BOPTest::OptionCommands (theCommands);
BOPTest::APICommands (theCommands);
BOPTest::OptionCommands (theCommands);
BOPTest::HistoryCommands (theCommands);
}
//=======================================================================
//function : Factory

View File

@@ -35,6 +35,7 @@
#include <IntTools_FaceFace.hxx>
#include <IntTools_Curve.hxx>
#include <IntTools_PntOn2Faces.hxx>
#include <BOPCol_ListOfShape.hxx>
@@ -641,9 +642,9 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
const TopoDS_Face& aF2=*(TopoDS_Face*)(&S2);
//
Standard_Boolean aToApproxC3d, aToApproxC2dOnS1, aToApproxC2dOnS2, anIsDone;
Standard_Integer i, aNbCurves;
Standard_Integer i, aNbCurves, aNbPoints;
Standard_Real anAppTol, aTolR;
TCollection_AsciiString aNm("c_");
TCollection_AsciiString aNm("c_"), aNp("p_");
//
anAppTol = 0.0000001;
aToApproxC3d = Standard_True;
@@ -678,77 +679,98 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
//
anIsDone=aFF.IsDone();
if (!anIsDone) {
di << " anIsDone=" << (Standard_Integer) anIsDone << "\n";
return 1;
di << "Error: anIsDone=" << (Standard_Integer) anIsDone << "\n";
return 0;
}
//
aFF.PrepareLines3D(Standard_False);
const IntTools_SequenceOfCurves& aSCs=aFF.Lines();
const IntTools_SequenceOfPntOn2Faces& aSPs = aFF.Points();
//
aNbCurves = aSCs.Length();
aNbPoints = aSPs.Length();
if (!aNbCurves && !aNbPoints) {
di << " has no 3d curves\n";
di << " has no 3d points\n";
return 0;
}
//
aTolR=aFF.TolReached3d();
di << "Tolerance Reached=" << aTolR << "\n";
aNbCurves=aSCs.Length();
if (!aNbCurves) {
di << " has no 3d curve\n";
return 1;
}
else
{
//
// curves
if (aNbCurves) {
di << aNbCurves << " curve(s) found.\n";
}
for (i=1; i<=aNbCurves; i++) {
const IntTools_Curve& anIC=aSCs(i);
Handle (Geom_Curve) aC3D = anIC.Curve();
if (aC3D.IsNull()) {
di << " has Null 3d curve# " << i << "\n";
continue;
}
TCollection_AsciiString anIndx(i), aNmx;
aNmx = aNm + anIndx;
Standard_CString nameC = aNmx.ToCString();
DrawTrSurf::Set(nameC, aC3D);
di << nameC << " ";
//
Handle(Geom2d_Curve) aPC1 = anIC.FirstCurve2d();
Handle(Geom2d_Curve) aPC2 = anIC.SecondCurve2d();
//
if (!aPC1.IsNull() || !aPC2.IsNull()) {
di << "(";
//
if (!aPC1.IsNull()) {
TCollection_AsciiString pc1N("c2d1_"), pc1Nx;
pc1Nx = pc1N + anIndx;
Standard_CString nameC2d1 = pc1Nx.ToCString();
//
DrawTrSurf::Set(nameC2d1, aPC1);
di << nameC2d1;
for (i=1; i<=aNbCurves; i++) {
const IntTools_Curve& anIC=aSCs(i);
Handle (Geom_Curve) aC3D = anIC.Curve();
if (aC3D.IsNull()) {
di << " has Null 3d curve# " << i << "\n";
continue;
}
TCollection_AsciiString anIndx(i), aNmx;
aNmx = aNm + anIndx;
Standard_CString nameC = aNmx.ToCString();
DrawTrSurf::Set(nameC, aC3D);
di << nameC << " ";
//
if (!aPC2.IsNull()) {
TCollection_AsciiString pc2N("c2d2_"), pc2Nx;
pc2Nx = pc2N + anIndx;
Standard_CString nameC2d2 = pc2Nx.ToCString();
//
DrawTrSurf::Set(nameC2d2, aPC2);
Handle(Geom2d_Curve) aPC1 = anIC.FirstCurve2d();
Handle(Geom2d_Curve) aPC2 = anIC.SecondCurve2d();
//
if (!aPC1.IsNull() || !aPC2.IsNull()) {
di << "(";
//
if (!aPC1.IsNull()) {
di << ", ";
TCollection_AsciiString pc1N("c2d1_"), pc1Nx;
pc1Nx = pc1N + anIndx;
Standard_CString nameC2d1 = pc1Nx.ToCString();
//
DrawTrSurf::Set(nameC2d1, aPC1);
di << nameC2d1;
}
di << nameC2d2;
//
if (!aPC2.IsNull()) {
TCollection_AsciiString pc2N("c2d2_"), pc2Nx;
pc2Nx = pc2N + anIndx;
Standard_CString nameC2d2 = pc2Nx.ToCString();
//
DrawTrSurf::Set(nameC2d2, aPC2);
//
if (!aPC1.IsNull()) {
di << ", ";
}
di << nameC2d2;
}
di << ") ";
}
di << ") ";
}
di << "\n";
}
//
// points
if (aNbPoints) {
di << aNbPoints << " point(s) found.\n";
//
for (i = 1; i <= aNbPoints; i++) {
const IntTools_PntOn2Faces& aPi = aSPs(i);
const gp_Pnt& aP = aPi.P1().Pnt();
//
TCollection_AsciiString anIndx(i), aNmx;
aNmx = aNp + anIndx;
Standard_CString nameP = aNmx.ToCString();
//
DrawTrSurf::Set(nameP, aP);
di << nameP << " ";
}
di << "\n";
}
//
di << "\n";
return 0;
}
//=======================================================================

View File

@@ -388,7 +388,9 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
Standard_Boolean isS2 = Standard_False;
Standard_Integer indxS2 = 0;
Standard_Real aTolerance = 0;
Standard_Boolean bRunParallel;
//
bRunParallel=BOPTest_Objects::RunParallel();
aTolerance=BOPTest_Objects::FuzzyValue();
if(n >= 3) {
@@ -433,6 +435,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
// init checker
BOPAlgo_ArgumentAnalyzer aChecker;
aChecker.SetRunParallel(bRunParallel);
aChecker.SetFuzzyValue(aTolerance);
aChecker.SetShape1(aS1);
@@ -999,7 +1002,7 @@ Standard_Integer checkcurveonsurf(Draw_Interpretor& di,
}
//
aTolE = BRep_Tool::Tolerance(aE);
if (aDMax < aTolE) {
if (!(aDMax > aTolE)) {
continue;
}
//

View File

@@ -0,0 +1,184 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2015 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 <BOPTest.ixx>
//
#include <Draw.hxx>
#include <DBRep.hxx>
//
#include <BRep_Builder.hxx>
//
#include <TopoDS_Compound.hxx>
//
#include <BOPAlgo_Builder.hxx>
//
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//
#include <BOPTest_DrawableShape.hxx>
#include <BOPTest_Objects.hxx>
//
static Standard_Integer bmodified (Draw_Interpretor&, Standard_Integer, const char**);
static Standard_Integer bgenerated (Draw_Interpretor&, Standard_Integer, const char**);
static Standard_Integer bisdeleted (Draw_Interpretor&, Standard_Integer, const char**);
//=======================================================================
//function : HistoryCommands
//purpose :
//=======================================================================
void BOPTest::HistoryCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean done = Standard_False;
if (done) return;
done = Standard_True;
// Chapter's name
const char* g = "BOPTest commands";
// Commands
theCommands.Add("bmodified" , "Use: bmodified rc shape", __FILE__, bmodified , g);
theCommands.Add("bgenerated", "Use: bgenerated rc shape", __FILE__, bgenerated, g);
theCommands.Add("bisdeleted", "Use: bisdeleted shape" , __FILE__, bisdeleted, g);
}
//=======================================================================
//function : bmodified
//purpose :
//=======================================================================
Standard_Integer bmodified(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n < 3) {
di << "Use: bmodified rc shape\n";
return 1;
}
//
TopoDS_Shape aS = DBRep::Get(a[2]);
if (aS.IsNull()) {
di << "Null shape\n";
return 1;
}
//
TopAbs_ShapeEnum aType = aS.ShapeType();
if (!(aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||
aType==TopAbs_FACE || aType==TopAbs_SOLID)) {
di << "The shape must be one of the following types: VERTEX, EDGE, FACE or SOLID\n";
return 1;
}
//
BOPAlgo_Builder& aBuilder = BOPTest_Objects::Builder();
const TopTools_ListOfShape& aLS = aBuilder.Modified(aS);
//
if (aLS.IsEmpty()) {
di << "The shape has not been modified\n";
return 0;
}
//
BRep_Builder aBB;
TopoDS_Compound aRes;
//
aBB.MakeCompound(aRes);
TopTools_ListIteratorOfListOfShape aIt(aLS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS = aIt.Value();
aBB.Add(aRes, aS);
}
//
DBRep::Set(a[1], aRes);
//
return 0;
}
//=======================================================================
//function : bgenerated
//purpose :
//=======================================================================
Standard_Integer bgenerated(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n < 3) {
di << "Use: bgenerated rc shape\n";
return 1;
}
//
TopoDS_Shape aS = DBRep::Get(a[2]);
if (aS.IsNull()) {
di << "Null shape\n";
return 1;
}
//
TopAbs_ShapeEnum aType = aS.ShapeType();
if (!(aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||
aType==TopAbs_FACE || aType==TopAbs_SOLID)) {
di << "The shape must be one of the following types: VERTEX, EDGE, FACE or SOLID\n";
return 1;
}
//
BOPAlgo_Builder& aBuilder = BOPTest_Objects::Builder();
const TopTools_ListOfShape& aLS = aBuilder.Generated(aS);
//
if (aLS.IsEmpty()) {
di << "No shapes were generated from the shape\n";
return 0;
}
//
BRep_Builder aBB;
TopoDS_Compound aRes;
//
aBB.MakeCompound(aRes);
TopTools_ListIteratorOfListOfShape aIt(aLS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS = aIt.Value();
aBB.Add(aRes, aS);
}
//
DBRep::Set(a[1], aRes);
//
return 0;
}
//=======================================================================
//function : bisdeleted
//purpose :
//=======================================================================
Standard_Integer bisdeleted(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n < 2) {
di << "Use: bisdeleted shape\n";
return 1;
}
//
TopoDS_Shape aS = DBRep::Get(a[1]);
if (aS.IsNull()) {
di << "Null shape\n";
return 1;
}
//
TopAbs_ShapeEnum aType = aS.ShapeType();
if (!(aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||
aType==TopAbs_FACE || aType==TopAbs_SOLID)) {
di << "The shape must be one of the following types: VERTEX, EDGE, FACE or SOLID\n";
return 1;
}
//
BOPAlgo_Builder& aBuilder = BOPTest_Objects::Builder();
Standard_Boolean isDeleted = aBuilder.IsDeleted(aS);
//
di << (isDeleted ? "Deleted" : "Not deleted") << "\n";
//
return 0;
}

View File

@@ -162,6 +162,7 @@ Standard_Integer bbuild(Draw_Interpretor& di,
//
BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller();
//
BOPTest_Objects::SetBuilderDefault();
BOPAlgo_Builder& aBuilder=BOPTest_Objects::Builder();
aBuilder.Clear();
//
@@ -324,6 +325,8 @@ Standard_Integer bbop(Draw_Interpretor& di,
return 0;
}
//
BOPTest_Objects::SetBuilder(pBuilder);
//
DBRep::Set(a[1], aR);
return 0;
}

View File

@@ -6,3 +6,6 @@ BOPTest_TolerCommands.cxx
BOPTest_ObjCommands.cxx
BOPTest_APICommands.cxx
BOPTest_OptionCommands.cxx
BOPTest_PartitionCommands.cxx
BOPTest_TolerCommands.cxx
BOPTest_HistoryCommands.cxx

View File

@@ -38,7 +38,8 @@ is
aF: Face from TopoDS);
---Purpose:
--- Compute P-Curve for the edge <aE> on the face <aF>
---
--- Raises exception Standard_ConstructionError if projection algorithm fails
EdgeTangent (myclass;
anE : Edge from TopoDS;
aT : Real from Standard;
@@ -56,8 +57,11 @@ is
V : out Real from Standard);
---Purpose:
--- Compute surface parameters <U,V> of the face <aF>
--- for the point from the edge <aE> at parameter <aT>.
---
--- for the point from the edge <aE> at parameter <aT>.
--- If <aE> has't pcurve on surface, algorithm tries to get it by
--- projection and can
--- raise exception Standard_ConstructionError if projection algorithm fails
CurveOnSurface (myclass;
aE: Edge from TopoDS;
aF: Face from TopoDS;
@@ -67,7 +71,8 @@ is
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
--- If the P-Curve does not exist, build it using Make2D().
--- [aToler] - reached tolerance
---
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
CurveOnSurface (myclass;
aE: Edge from TopoDS;
aF: Face from TopoDS;
@@ -81,7 +86,8 @@ is
--- If the P-Curve does not exist, build it using Make2D().
--- [aFirst, aLast] - range of the P-Curve
--- [aToler] - reached tolerance
---
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
HasCurveOnSurface (myclass;
aE: Edge from TopoDS;
aF: Face from TopoDS;
@@ -167,18 +173,8 @@ is
--- Make P-Curve <aC> for the edge <aE> on surface <aF> .
--- [aFirst, aLast] - range of the P-Curve
--- [aToler] - reached tolerance
---
--- Raises exception Standard_ConstructionError if algorithm fails
MakeCurveOnSurface (myclass;
aE: Edge from TopoDS;
aF: Face from TopoDS;
aC : out Curve from Geom2d;
aFirst: out Real from Standard;
aLast : out Real from Standard;
aToler: out Real from Standard);
---Purpose:
--- Same as Make2D()
---
MakePCurveOnFace (myclass;
aF: Face from TopoDS;
C3D : Curve from Geom;
@@ -187,7 +183,8 @@ is
---Purpose:
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
--- [aToler] - reached tolerance
---
--- Raises exception Standard_ConstructionError if projection algorithm fails
MakePCurveOnFace (myclass;
aF: Face from TopoDS;
C3D : Curve from Geom;
@@ -199,7 +196,8 @@ is
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
--- [aT1, aT2] - range to build
--- [aToler] - reached tolerance
---
--- Raises exception Standard_ConstructionError if projection algorithm fails
MakePCurveOfType (myclass;
PC : ProjectedCurve from ProjLib;
aC : out Curve from Geom2d);

View File

@@ -15,6 +15,7 @@
#include <BOPTools_AlgoTools2D.ixx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ConstructionError.hxx>
#include <Precision.hxx>
#include <gp.hxx>
@@ -652,6 +653,12 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
aTolR = aProj3.GetTolerance();
}
}
//
if(aC2D.IsNull())
{
Standard_ConstructionError::Raise("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
}
//
TolReached2d=aTolR;
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2,
aC2D, aC2DA);

View File

@@ -85,13 +85,14 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
//
bIsToReverse=IsToReverse(aE2, aE1, aCtx);
if (bIsToReverse) {
Standard_Real aT21r, aT22r;
//
aC2DoldC->Reverse();
//
gp_Pnt2d aP1, aP2;
//
aC2Dold->D0(aT22, aP2);
aC2DoldC->D0(aT21, aP1);
aC2DoldC->Translate(aP1, aP2);
aT21r=aC2DoldC->ReversedParameter(aT21);
aT22r=aC2DoldC->ReversedParameter(aT22);
aT21=aT22r;
aT22=aT21r;
}
//
aC2DT=new Geom2d_TrimmedCurve(aC2DoldC, aT21, aT22);

View File

@@ -111,7 +111,7 @@ static
static
Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
const TopoDS_Face& aF,
const Handle(Geom_Surface)& aS,
const GeomAdaptor_Surface& aS,
const TopoDS_Edge& aE1,
const TopoDS_Edge& aE2);
@@ -558,7 +558,7 @@ void CorrectWires(const TopoDS_Face& aFx)
aT=BRep_Tool::Parameter(aV, aE);
//
aC2D->D0(aT, aP2D);
aS->D0(aP2D.X(), aP2D.Y(), aP);
aGAS.D0(aP2D.X(), aP2D.Y(), aP);
aD2=aPV.SquareDistance(aP);
if (aD2>aD2max) {
aD2max=aD2;
@@ -586,7 +586,7 @@ void CorrectWires(const TopoDS_Face& aFx)
continue;
}
//
aD2=IntersectCurves2d(aPV, aF, aS, aE, aE1);
aD2=IntersectCurves2d(aPV, aF, aGAS, aE, aE1);
if (aD2>aD2max) {
aD2max=aD2;
}
@@ -606,7 +606,7 @@ void CorrectWires(const TopoDS_Face& aFx)
//=======================================================================
Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
const TopoDS_Face& aF,
const Handle(Geom_Surface)& aS,
const GeomAdaptor_Surface& aGAS,
const TopoDS_Edge& aE1,
const TopoDS_Edge& aE2)
{
@@ -650,7 +650,7 @@ Standard_Real IntersectCurves2d(const gp_Pnt& aPV,
}
//
aP2D = aPoint.Value();
aS->D0(aP2D.X(), aP2D.Y(), aP);
aGAS.D0(aP2D.X(), aP2D.Y(), aP);
aD=aPV.SquareDistance(aP);
if (aD > aDist) {
aDist = 1.01 * aD;

View File

@@ -337,22 +337,24 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
return nullPCurve;
}
aCurveLocation = L.Predivided(aCurveLocation);
aCurveLocation = aCurveLocation.Predivided(L);
First = f; Last = l; //Range of edge must not be modified
Handle(Geom_Plane) Plane = GP;
if (!aCurveLocation.IsIdentity())
{
const gp_Trsf& T = aCurveLocation.Transformation();
Handle(Geom_Geometry) GPT = GP->Transformed(T);
Plane = *((Handle(Geom_Plane)*)&GPT);
Handle(Geom_Geometry) GC3d = C3d->Transformed(T);
C3d = *((Handle(Geom_Curve)*)&GC3d);
f = C3d->TransformedParameter(f, T);
l = C3d->TransformedParameter(l, T);
}
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
GAS.Load(Plane);
GAS.Load(GP);
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l,Standard_True,Standard_False),
Plane,
Plane->Position().Direction(),
GP,
GP->Position().Direction(),
Standard_True);
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
@@ -366,7 +368,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
(*((Handle(Geom2d_TrimmedCurve)*)&pc));
pc = TC->BasisCurve();
}
First = f; Last = l;
return pc;
}

View File

@@ -37,21 +37,25 @@ is
returns Copy from BRepBuilderAPI;
Create(S: Shape from TopoDS; copyGeom: Boolean = Standard_True)
Create(S: Shape from TopoDS; copyGeom: Boolean = Standard_True; copyMesh: Boolean = Standard_False)
---Purpose: Constructs a copy framework and copies the shape S.
-- Use the function Shape to access the result.
-- If copyMesh is True, triangulation contained in original shape will be
-- copied along with geometry (by default, triangulation gets lost).
-- If copyGeom is False, only topological objects will be copied, while
-- geometry will be shared with original shape.
-- geometry and triangulation will be shared with original shape.
-- Note: the constructed framework can be reused to copy
-- other shapes: just specify them with the function Perform.
returns Copy from BRepBuilderAPI;
Perform(me: in out; S: Shape from TopoDS; copyGeom: Boolean = Standard_True)
Perform(me: in out; S: Shape from TopoDS; copyGeom: Boolean = Standard_True; copyMesh: Boolean = Standard_False)
---Purpose: Copies the shape S.
-- Use the function Shape to access the result.
-- If copyMesh is True, triangulation contained in original shape will be
-- copied along with geometry (by default, triangulation gets lost).
-- If copyGeom is False, only topological objects will be copied, while
-- geometry will be shared with original shape.
-- geometry and triangulation will be shared with original shape.
is static;

View File

@@ -23,13 +23,18 @@
#include <BRep_Tool.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
#include <Poly_Triangulation.hxx>
namespace {
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification
{
public:
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom)
: myCopyGeom(copyGeom)
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom,
const Standard_Boolean copyMesh)
: myCopyGeom(copyGeom),
myCopyMesh(copyMesh)
{
}
@@ -49,6 +54,24 @@ public:
return Standard_True;
}
//! Returns true to indicate the need to copy triangulation;
//! copies it if required
Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T)
{
if (!myCopyMesh)
return Standard_False;
TopLoc_Location L;
T = BRep_Tool::Triangulation(F, L);
if (T.IsNull())
return Standard_False;
if (myCopyGeom)
T = T->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies curves if requested
Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C,
@@ -117,13 +140,15 @@ public:
private:
Standard_Boolean myCopyGeom;
Standard_Boolean myCopyMesh;
};
DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
IMPLEMENT_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
IMPLEMENT_STANDARD_RTTIEXT(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
} // anonymous namespace
//=======================================================================
//function : BRepBuilderAPI_Copy
//purpose :
@@ -131,7 +156,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepBuilderAPI_Copy_Modification, BRepTools_Modificat
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
{
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True);
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True, Standard_False);
}
@@ -140,9 +165,9 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
//purpose :
//=======================================================================
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom)
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
DoModif(S);
}
@@ -152,9 +177,9 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_B
//purpose :
//=======================================================================
void BRepBuilderAPI_Copy::Perform(const TopoDS_Shape& S, const Standard_Boolean copyGeom)
void BRepBuilderAPI_Copy::Perform(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
NotDone(); // on force la copie si on vient deja d`en faire une
DoModif(S);
}

View File

@@ -492,9 +492,83 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge,
return Standard_True;
}
static inline Standard_Real ComputeToleranceVertex(const Standard_Real dist, const Standard_Real Tol1, const Standard_Real Tol2)
static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2,
TopoDS_Vertex& theNewV)
{
return (dist * 0.5 + Tol1 + Tol2);
Standard_Integer m, n;
Standard_Real aR[2], dR, aD, aEps;
TopoDS_Vertex aV[2];
gp_Pnt aP[2];
BRep_Builder aBB;
//
aEps = RealEpsilon();
aV[0] = theV1;
aV[1] = theV2;
for (m = 0; m < 2; ++m) {
aP[m] = BRep_Tool::Pnt(aV[m]);
aR[m] = BRep_Tool::Tolerance(aV[m]);
}
//
m=0; // max R
n=1; // min R
if (aR[0] < aR[1]) {
m=1;
n=0;
}
//
dR = aR[m] - aR[n]; // dR >= 0.
gp_Vec aVD(aP[m], aP[n]);
aD = aVD.Magnitude();
//
if (aD <= dR || aD < aEps) {
aBB.MakeVertex (theNewV, aP[m], aR[m]);
}
else {
Standard_Real aRr;
gp_XYZ aXYZr;
gp_Pnt aPr;
//
aRr = 0.5 * (aR[m] + aR[n] + aD);
aXYZr = 0.5 * (aP[m].XYZ() + aP[n].XYZ() - aVD.XYZ() * (dR/aD));
aPr.SetXYZ(aXYZr);
//
aBB.MakeVertex (theNewV, aPr, aRr);
}
return;
}
static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2,
TopoDS_Vertex theV3, TopoDS_Vertex& theNewV)
{
Standard_Real aDi, aDmax;
gp_Pnt aCenter;
gp_Pnt aP[3];
Standard_Real aR[3];
TopoDS_Vertex aV[3];
gp_XYZ aXYZ(0.,0.,0.);
aV[0] = theV1;
aV[1] = theV2;
aV[2] = theV3;
for (Standard_Integer i = 0; i < 3; ++i) {
aP[i] = BRep_Tool::Pnt(aV[i]);
aR[i] = BRep_Tool::Tolerance(aV[i]);
aXYZ = aXYZ + aP[i].XYZ();
}
//
aXYZ.Divide(3.0);
aCenter.SetXYZ(aXYZ);
//
aDmax=-1.;
for ( Standard_Integer i = 0; i < 3; ++i) {
aDi = aCenter.Distance(aP[i]);
aDi += aR[i];
if (aDi > aDmax)
aDmax = aDi;
}
BRep_Builder aBB;
aBB.MakeVertex (theNewV, aCenter, aDmax);
return;
}
TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirst,
const TopoDS_Edge& edgeLast,
@@ -604,111 +678,54 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
//V21 = TopoDS::Vertex(myReShape->Apply(V21));
//V22 = TopoDS::Vertex(myReShape->Apply(V22));
gp_Pnt p11 = BRep_Tool::Pnt(V11);
gp_Pnt p12 = BRep_Tool::Pnt(V12);
gp_Pnt p21 = BRep_Tool::Pnt(V21);
gp_Pnt p22 = BRep_Tool::Pnt(V22);
//Standard_Boolean isRev = Standard_False;
gp_Pnt pfirst;
Standard_Real Tol1 = 0.;
if (isClosed1 || isClosed2) {
// at least one of the edges is closed
if (isClosed1 && isClosed2) {
// both edges are closed
pfirst.SetXYZ(0.5*(p11.XYZ() + p21.XYZ()));
gp_Vec v1 = p21.XYZ() - p11.XYZ();
Standard_Real d1 = v1.Magnitude();
Tol1 = ComputeToleranceVertex(d1,BRep_Tool::Tolerance(V11),BRep_Tool::Tolerance(V21));
//Tol1 = Max(pfirst.Distance(p11),pfirst.Distance(p21));
ComputeToleranceVertex(V11, V21, V1New);
}
else if (isClosed1) {
// only first edge is closed
gp_XYZ pt =0.5*(p21.XYZ()+ p22.XYZ());
pfirst.SetXYZ(0.5*(p11.XYZ() + pt));
gp_Vec v1 = p22.XYZ() - p21.XYZ();
Standard_Real d1 = v1.Magnitude();
Tol1= ComputeToleranceVertex(d1,BRep_Tool::Tolerance(V22),BRep_Tool::Tolerance(V21));
gp_Vec v2 = p11.XYZ() - pt;
Standard_Real d2 = v2.Magnitude();
Tol1= ComputeToleranceVertex(d2,Tol1,BRep_Tool::Tolerance(V11));
//Tol1 = Max(pfirst.Distance(p21),pfirst.Distance(p22));
//Tol1 = Max(pfirst.Distance(p11),Tol1);
ComputeToleranceVertex(V22, V21, V11, V1New);
}
else {
// only second edge is closed
gp_XYZ pt = 0.5*(p11.XYZ()+ p12.XYZ());
pfirst.SetXYZ(0.5*(p21.XYZ() + pt));
gp_Vec v1 = p11.XYZ() - p12.XYZ();
Standard_Real d1 = v1.Magnitude();
Tol1 = ComputeToleranceVertex(d1,BRep_Tool::Tolerance(V11),BRep_Tool::Tolerance(V12));
gp_Vec v2 = p21.XYZ() - pt;
Standard_Real d2 = v2.Magnitude();
Tol1 = ComputeToleranceVertex(d2,Tol1,BRep_Tool::Tolerance(V21));
//Tol1 = Max(pfirst.Distance(p11),pfirst.Distance(p12));
//Tol1 = Max(pfirst.Distance(p21),Tol1);
ComputeToleranceVertex(V11, V12, V21, V1New);
}
aBuilder.MakeVertex(V1New,pfirst,Tol1);
V2New = V1New;
}
else {
// both edges are open
gp_Pnt plast;
Standard_Real Tol2 = 0.;
Standard_Boolean isOldFirst = ( secForward ? V11.IsSame(V21) : V11.IsSame(V22) );
Standard_Boolean isOldLast = ( secForward ? V12.IsSame(V22) : V12.IsSame(V21)) ;
if (secForward) {
//case if vertices already sewed
if(!isOldFirst)
{
pfirst.SetXYZ(0.5*(p11.XYZ() + p21.XYZ()));
gp_Vec v1 = p21.XYZ() - p11.XYZ();
Standard_Real d1 = v1.Magnitude();
Tol1 = ComputeToleranceVertex(d1,BRep_Tool::Tolerance(V11),BRep_Tool::Tolerance(V21));
ComputeToleranceVertex(V11, V21, V1New);
}
if(!isOldLast)
{
plast.SetXYZ(0.5*(p12.XYZ() + p22.XYZ()));
gp_Vec v2 = p22.XYZ() - p12.XYZ();
Standard_Real d2 = v2.Magnitude();
Tol2 = ComputeToleranceVertex(d2,BRep_Tool::Tolerance(V12),BRep_Tool::Tolerance(V22));
ComputeToleranceVertex(V12, V22, V2New);
}
}
else {
if(!isOldFirst)
{
pfirst.SetXYZ(0.5*(p11.XYZ() + p22.XYZ()));
gp_Vec v1 = p22.XYZ() - p11.XYZ();
Standard_Real d1 = v1.Magnitude();
Tol1 = ComputeToleranceVertex(d1,BRep_Tool::Tolerance(V11),BRep_Tool::Tolerance(V22));
ComputeToleranceVertex(V11, V22, V1New);
}
if(!isOldLast)
{
plast.SetXYZ(0.5*(p12.XYZ() + p21.XYZ()));
gp_Vec v2 = p21.XYZ() - p12.XYZ();
Standard_Real d2 = v2.Magnitude();
Tol2 = ComputeToleranceVertex(d2,BRep_Tool::Tolerance(V12),BRep_Tool::Tolerance(V21));
ComputeToleranceVertex(V12, V21, V2New);
}
}
if(!isOldFirst)
aBuilder.MakeVertex(V1New,pfirst,Tol1);
else
if(isOldFirst)
V1New = V11;
if(!isOldLast)
aBuilder.MakeVertex(V2New,plast,Tol2);
else
if(isOldLast)
V2New = V12;
}
// Add the vertices in the good sense
TopoDS_Shape anEdge = edge.Oriented(TopAbs_FORWARD);
TopoDS_Shape aLocalEdge = V1New.Oriented(TopAbs_FORWARD); //(listNode.First()).Oriented(TopAbs_FORWARD);

View File

@@ -69,17 +69,17 @@
//modified by NIZNHY-PKV Thu May 05 09:01:57 2011f
static
Standard_Boolean Validate(const Adaptor3d_Curve&,
const Adaptor3d_CurveOnSurface&,
const Standard_Real,
const Standard_Boolean);
const Adaptor3d_CurveOnSurface&,
const Standard_Real,
const Standard_Boolean);
static
void PrintProblematicPoint(const gp_Pnt&,
const Standard_Real,
const Standard_Real);
const Standard_Real,
const Standard_Real);
static
Standard_Real Prec(const Adaptor3d_Curve& aAC3D,
const Adaptor3d_CurveOnSurface& aACS);
const Adaptor3d_CurveOnSurface& aACS);
static
Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D);
static
@@ -125,27 +125,27 @@ void BRepCheck_Edge::Minimum()
Standard_Boolean unique = Standard_True;
// Search for a 3D reference. If no existent one, creates it with the
// first encountered CurveOnSurf; if multiple, chooses the first one...
Standard_Boolean Degenerated = TE->Degenerated();
Standard_Boolean SameParameter = TE->SameParameter();
Standard_Boolean SameRange = TE->SameRange();
if (!SameRange && SameParameter) {
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
// Handle(Geom_Curve) C3d;
// Handle(Geom_Curve) C3d;
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurve3D()) {
if (!exist) {
exist = Standard_True;
}
else {
unique = Standard_False;
}
if (myCref.IsNull() && !cr->Curve3D().IsNull()) {
myCref = cr;
}
if (!exist) {
exist = Standard_True;
}
else {
unique = Standard_False;
}
if (myCref.IsNull() && !cr->Curve3D().IsNull()) {
myCref = cr;
}
}
itcr.Next();
}
@@ -161,12 +161,12 @@ void BRepCheck_Edge::Minimum()
if (myCref.IsNull() && !Degenerated) {
itcr.Initialize(TE->Curves());
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface()) {
myCref = cr;
break;
}
itcr.Next();
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface()) {
myCref = cr;
break;
}
itcr.Next();
}
}
else if (!myCref.IsNull() && Degenerated){
@@ -178,32 +178,33 @@ void BRepCheck_Edge::Minimum()
Standard_Real First,Last;
GCref->Range(First,Last);
if (Last<=First) {
myCref.Nullify();
BRepCheck::Add(lst,BRepCheck_InvalidRange);
myCref.Nullify();
BRepCheck::Add(lst,BRepCheck_InvalidRange);
}
else {
if (myCref->IsCurve3D()) {
if (myCref->IsCurve3D()) {
// eap 6 Jun 2002 occ332
// better transform C3d instead of transforming Surf upto C3d initial location,
// on transformed BSpline surface 'same parameter' may seem wrong
TopLoc_Location L = myShape.Location() * myCref->Location();
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
(myCref->Curve3D()->Transformed
(/*myCref->Location()*/L.Transformation()));
GeomAdaptor_Curve GAC3d(C3d,First,Last);
myHCurve = new GeomAdaptor_HCurve(GAC3d);
}
else { // curve on surface
Handle(Geom_Surface) Sref = myCref->Surface();
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed(myCref->Location().Transformation()));
const Handle(Geom2d_Curve)& PCref = myCref->PCurve();
Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
Handle(Geom2dAdaptor_HCurve) GHPCref =
new Geom2dAdaptor_HCurve(PCref,First,Last);
Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
myHCurve = new Adaptor3d_HCurveOnSurface(ACSref);
}
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
(myCref->Curve3D()->Transformed
(/*myCref->Location()*/L.Transformation()));
GeomAdaptor_Curve GAC3d(C3d, C3d->TransformedParameter(First, L.Transformation()),
C3d->TransformedParameter(Last, L.Transformation()));
myHCurve = new GeomAdaptor_HCurve(GAC3d);
}
else { // curve on surface
Handle(Geom_Surface) Sref = myCref->Surface();
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed(myCref->Location().Transformation()));
const Handle(Geom2d_Curve)& PCref = myCref->PCurve();
Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
Handle(Geom2dAdaptor_HCurve) GHPCref =
new Geom2dAdaptor_HCurve(PCref,First,Last);
Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
myHCurve = new Adaptor3d_HCurveOnSurface(ACSref);
}
}
}
if (lst.IsEmpty()) {
@@ -232,7 +233,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape));
TopAbs_ShapeEnum styp = S.ShapeType();
// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
TopExp_Explorer exp(S,TopAbs_EDGE) ;
for ( ; exp.More(); exp.Next()) {
if (exp.Current().IsSame(myShape)) {
@@ -243,7 +244,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape);
return;
}
switch (styp)
{
case TopAbs_WIRE:
@@ -253,19 +254,19 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
case TopAbs_FACE:
if (!myCref.IsNull()) {
Standard_Boolean SameParameter = TE->SameParameter();
Standard_Boolean SameRange = TE->SameRange();
// Modified by skv - Tue Apr 27 11:48:13 2004 Begin
// Modified by skv - Tue Apr 27 11:48:13 2004 Begin
if (!SameParameter || !SameRange) {
if (!SameParameter)
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
if (!SameRange)
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
if (!SameParameter)
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
if (!SameRange)
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
return;
return;
}
// Modified by skv - Tue Apr 27 11:48:14 2004 End
// Modified by skv - Tue Apr 27 11:48:14 2004 End
Standard_Real First = myHCurve->FirstParameter();
Standard_Real Last = myHCurve->LastParameter();
@@ -274,121 +275,125 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
const TopLoc_Location& TFloc = TF->Location();
const Handle(Geom_Surface)& Su = TF->Surface();
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
TopLoc_Location LE = myShape.Location() * myCref->Location();
const gp_Trsf& Etrsf = LE.Transformation();
Standard_Boolean pcurvefound = Standard_False;
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
pcurvefound = Standard_True;
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
Standard_Real f,l;
GC->Range(f,l);
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
pcurvefound = Standard_True;
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
Standard_Real f,l;
GC->Range(f,l);
Standard_Real ff = f, ll = l;
if(myCref->IsCurve3D())
{
ff = myCref->Curve3D()->TransformedParameter(f, Etrsf);
ll = myCref->Curve3D()->TransformedParameter(l, Etrsf);
}
// gka OCC
// Modified by skv - Tue Apr 27 11:50:35 2004 Begin
// if (SameRange && (fabs(f-First) > Precision::PConfusion() || fabs(l-Last)> Precision::PConfusion())) { //f != First || l != Last)) { gka OCC
if (Abs(f-First) > Precision::PConfusion() ||
Abs(l-Last) > Precision::PConfusion()) {
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// if (SameParameter) {
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// }
}
// Modified by skv - Tue Apr 27 11:50:37 2004 End
if (myGctrl) {
Handle(Geom_Surface) Sb = cr->Surface();
Sb = Handle(Geom_Surface)::DownCast
// (Su->Transformed(L.Transformation()));
(Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
Handle(Geom2d_Curve) PC = cr->PCurve();
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok =
Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
if (!ok) {
if (cr->IsCurveOnClosedSurface()) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
}
else {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
// Modified by skv - Tue Apr 27 11:53:00 2004 Begin
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// if (SameParameter) {
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// }
// Modified by skv - Tue Apr 27 11:53:01 2004 End
}
if (cr->IsCurveOnClosedSurface()) {
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
ACS.Load(GAHS); // sans doute inutile
ACS.Load(GHPC); // meme remarque...
ok = Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
// Modified by skv - Tue Apr 27 11:53:20 2004 Begin
if (SameParameter) {
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
// Modified by skv - Tue Apr 27 11:53:23 2004 End
}
}
}
}
itcr.Next();
// Modified by skv - Tue Apr 27 11:50:35 2004 Begin
if (Abs(ff-First) > Precision::PConfusion() ||
Abs(ll-Last) > Precision::PConfusion()) {
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
// Modified by skv - Tue Apr 27 11:50:37 2004 End
if (myGctrl) {
Handle(Geom_Surface) Sb = cr->Surface();
Sb = Handle(Geom_Surface)::DownCast
// (Su->Transformed(L.Transformation()));
(Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
Handle(Geom2d_Curve) PC = cr->PCurve();
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok =
Validate(myHCurve->Curve() ,ACS,Tol,SameParameter);
if (!ok) {
if (cr->IsCurveOnClosedSurface()) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
}
else {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
// Modified by skv - Tue Apr 27 11:53:00 2004 Begin
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// if (SameParameter) {
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
// }
// Modified by skv - Tue Apr 27 11:53:01 2004 End
}
if (cr->IsCurveOnClosedSurface()) {
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
ACS.Load(GAHS); // sans doute inutile
ACS.Load(GHPC); // meme remarque...
ok = Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
// Modified by skv - Tue Apr 27 11:53:20 2004 Begin
if (SameParameter) {
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
}
// Modified by skv - Tue Apr 27 11:53:23 2004 End
}
}
}
}
itcr.Next();
}
if (!pcurvefound) {
Handle(Geom_Plane) P;
Handle(Standard_Type) dtyp = Su->DynamicType();
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
P = Handle(Geom_Plane)::DownCast
(Handle(Geom_RectangularTrimmedSurface)::
DownCast(Su)->BasisSurface());
}
else {
P = Handle(Geom_Plane)::DownCast(Su);
}
if (P.IsNull()) { // not a plane
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
}
else { // on fait la projection a la volee, comme BRep_Tool
// plan en position
if (myGctrl) {
P = Handle(Geom_Plane)::
DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
//on projette Cref sur ce plan
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
Handle(Geom_Plane) P;
Handle(Standard_Type) dtyp = Su->DynamicType();
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
P = Handle(Geom_Plane)::DownCast
(Handle(Geom_RectangularTrimmedSurface)::
DownCast(Su)->BasisSurface());
}
else {
P = Handle(Geom_Plane)::DownCast(Su);
}
if (P.IsNull()) { // not a plane
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
}
else { // on fait la projection a la volee, comme BRep_Tool
// plan en position
if (myGctrl) {
P = Handle(Geom_Plane)::
DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
//on projette Cref sur ce plan
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve
GeomAdaptor_Curve& Gac =
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
Handle(Geom_Curve) C3d = Gac.Curve();
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
P, P->Position().Direction(),
Standard_True);
Handle(GeomAdaptor_HCurve) aHCurve =
new GeomAdaptor_HCurve(ProjOnPlane);
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve
GeomAdaptor_Curve& Gac =
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
Handle(Geom_Curve) C3d = Gac.Curve();
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
P, P->Position().Direction(),
Standard_True);
Handle(GeomAdaptor_HCurve) aHCurve =
new GeomAdaptor_HCurve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_HCurve) GHPC =
new Geom2dAdaptor_HCurve(PC,
myHCurve->FirstParameter(),
myHCurve->LastParameter());
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_HCurve) GHPC =
new Geom2dAdaptor_HCurve(PC,
myHCurve->FirstParameter(),
myHCurve->LastParameter());
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok = Validate(myHCurve->Curve(),ACS,
Tol,Standard_True); // voir dub...
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
}
}
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
Standard_Boolean ok = Validate(myHCurve->Curve(),ACS,
Tol,Standard_True); // voir dub...
if (!ok) {
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
}
}
}
}
}
break;
@@ -398,22 +403,22 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Standard_Integer nbconnection = 0;
//TopExp_Explorer exp;
for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next()) {
const TopoDS_Face& fac = TopoDS::Face(exp.Current());
TopExp_Explorer exp2;
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next()) {
if (exp2.Current().IsSame(myShape)) {
nbconnection++;
}
}
const TopoDS_Face& fac = TopoDS::Face(exp.Current());
TopExp_Explorer exp2;
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next()) {
if (exp2.Current().IsSame(myShape)) {
nbconnection++;
}
}
}
if (nbconnection < 2 && !TE->Degenerated()) {
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
}
else if (nbconnection > 2) {
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
}
else {
BRepCheck::Add(myMap(S),BRepCheck_NoError);
BRepCheck::Add(myMap(S),BRepCheck_NoError);
}
}
break;
@@ -433,12 +438,12 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
void BRepCheck_Edge::Blind()
{
// Modified by skv - Tue Apr 27 11:36:01 2004 Begin
// The body of this function is removed because of its useless.
// Modified by skv - Tue Apr 27 11:36:01 2004 Begin
// The body of this function is removed because of its useless.
if (!myBlind) {
myBlind = Standard_True;
}
// Modified by skv - Tue Apr 27 11:36:02 2004 End
// Modified by skv - Tue Apr 27 11:36:02 2004 End
}
@@ -469,7 +474,7 @@ Standard_Boolean BRepCheck_Edge::GeometricControls() const
//=======================================================================
void BRepCheck_Edge::SetStatus(const BRepCheck_Status theStatus)
{
BRepCheck::Add(myMap(myShape),theStatus);
BRepCheck::Add(myMap(myShape),theStatus);
}
@@ -502,13 +507,13 @@ Standard_Real BRepCheck_Edge::Tolerance()
//// modified by jgv, 20.03.03 ////
TopLoc_Location Loc = myShape.Location() * cr->Location();
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
(cr->Curve3D()->Transformed( Loc.Transformation() ));
(cr->Curve3D()->Transformed( Loc.Transformation() ));
///////////////////////////////////
GeomAdaptor_Curve GAC3d(C3d,First,Last);
it=iRep;
if (iRep>1) {
theRep(iRep)=theRep(1);
it=1;
theRep(iRep)=theRep(1);
it=1;
}
theRep(it) = new GeomAdaptor_HCurve(GAC3d);
iRep++;
@@ -516,11 +521,11 @@ Standard_Real BRepCheck_Edge::Tolerance()
else if (cr->IsCurveOnSurface()) {
{
Handle(Geom_Surface) Sref = cr->Surface();
//// modified by jgv, 20.03.03 ////
TopLoc_Location Loc = myShape.Location() * cr->Location();
//// modified by jgv, 20.03.03 ////
TopLoc_Location Loc = myShape.Location() * cr->Location();
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed( Loc.Transformation() ));
///////////////////////////////////
///////////////////////////////////
const Handle(Geom2d_Curve)& PCref = cr->PCurve();
Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
Handle(Geom2dAdaptor_HCurve) GHPCref =
@@ -530,17 +535,17 @@ Standard_Real BRepCheck_Edge::Tolerance()
iRep++;
}
if (cr->IsCurveOnClosedSurface()) {
Handle(Geom_Surface) Sref = cr->Surface();
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed(cr->Location().Transformation()));
const Handle(Geom2d_Curve)& PCref = cr->PCurve2();
Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
Handle(Geom2dAdaptor_HCurve) GHPCref =
new Geom2dAdaptor_HCurve(PCref,First,Last);
Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
theRep(iRep) = new Adaptor3d_HCurveOnSurface(ACSref);
iRep++;
nbRep++;
Handle(Geom_Surface) Sref = cr->Surface();
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed(cr->Location().Transformation()));
const Handle(Geom2d_Curve)& PCref = cr->PCurve2();
Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
Handle(Geom2dAdaptor_HCurve) GHPCref =
new Geom2dAdaptor_HCurve(PCref,First,Last);
Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
theRep(iRep) = new Adaptor3d_HCurveOnSurface(ACSref);
iRep++;
nbRep++;
}
}
else {
@@ -574,10 +579,10 @@ Standard_Real BRepCheck_Edge::Tolerance()
//purpose :
//=======================================================================
BRepCheck_Status BRepCheck_Edge::
CheckPolygonOnTriangulation(const TopoDS_Edge& theEdge)
CheckPolygonOnTriangulation(const TopoDS_Edge& theEdge)
{
BRep_ListOfCurveRepresentation& aListOfCR =
(*((Handle(BRep_TEdge)*) &theEdge.TShape()))->ChangeCurves();
(*((Handle(BRep_TEdge)*) &theEdge.TShape()))->ChangeCurves();
BRep_ListIteratorOfListOfCurveRepresentation anITCR(aListOfCR);
BRepAdaptor_Curve aBC;
@@ -596,30 +601,30 @@ BRepCheck_Status BRepCheck_Edge::
const Handle(BRep_CurveRepresentation) aCR = anITCR.Value();
const Handle(BRep_PolygonOnTriangulation)& aPT =
Handle(BRep_PolygonOnTriangulation)::DownCast(aCR);
Handle(BRep_PolygonOnTriangulation)::DownCast(aCR);
const TopLoc_Location aLL = theEdge.Location() * aPT->Location();
const Handle(Poly_Triangulation) aTriang = aCR->Triangulation();
const Handle(Poly_PolygonOnTriangulation) aPOnTriag =
aCR->IsPolygonOnClosedTriangulation() ?
aCR->PolygonOnTriangulation2() :
aCR->PolygonOnTriangulation();
aCR->IsPolygonOnClosedTriangulation() ?
aCR->PolygonOnTriangulation2() :
aCR->PolygonOnTriangulation();
const TColStd_Array1OfInteger& anIndices = aPOnTriag->Nodes();
const TColgp_Array1OfPnt& Nodes = aTriang->Nodes();
const Standard_Integer aNbNodes = anIndices.Length();
const Standard_Real aTol = aPOnTriag->Deflection() +
BRep_Tool::Tolerance(theEdge);
BRep_Tool::Tolerance(theEdge);
if(aPOnTriag->HasParameters())
{
for(Standard_Integer i = aPOnTriag->Parameters()->Lower();
i <= aPOnTriag->Parameters()->Upper(); i++)
i <= aPOnTriag->Parameters()->Upper(); i++)
{
const Standard_Real aParam = aPOnTriag->Parameters()->Value(i);
const gp_Pnt aPE(aBC.Value(aParam)),
aPT(Nodes(anIndices(i)).Transformed(aLL));
aPT(Nodes(anIndices(i)).Transformed(aLL));
const Standard_Real aSQDist = aPE.SquareDistance(aPT);
if(aSQDist > aTol*aTol)
@@ -681,9 +686,9 @@ BRepCheck_Status BRepCheck_Edge::
//purpose :
//=======================================================================
Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
const Adaptor3d_CurveOnSurface& Other,
const Standard_Real Tol,
const Standard_Boolean SameParameter)
const Adaptor3d_CurveOnSurface& Other,
const Standard_Real Tol,
const Standard_Boolean SameParameter)
{
Standard_Boolean Status, proj;
Standard_Real aPC, First, Last, Error;
@@ -693,11 +698,11 @@ Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
Error = 0.;
First = CRef.FirstParameter();
Last = CRef.LastParameter();
aPC=Precision::PConfusion();
proj = (!SameParameter ||
Abs(Other.FirstParameter()-First) > aPC ||
Abs( Other.LastParameter()-Last) > aPC);
Abs(Other.FirstParameter()-First) > aPC ||
Abs( Other.LastParameter()-Last) > aPC);
if (!proj)
{
Standard_Integer i;
@@ -710,17 +715,17 @@ Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
Tol2=Tol2*Tol2;
//Tol2=Tol*Tol;
//modified by NIZNHY-PKV Thu May 05 09:06:47 2011t
for (i = 0; i < NCONTROL; ++i) {
prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
pref = CRef.Value(prm);
pother = Other.Value(prm);
if (pref.SquareDistance(pother) > Tol2) {
problematic_point = pref ;
Status = Standard_False;
Error = pref.Distance(pother);
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
problematic_point = pref ;
Status = Standard_False;
Error = pref.Distance(pother);
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
//goto FINISH ;
}
}
@@ -761,44 +766,44 @@ Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
gp_Pnt pother = Other.Value(oprm);
refd.Perform(pother,rprm);
if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol) {
problematic_point = pref ;
Status = Standard_False ;
if (refd.IsDone()) {
Error = sqrt (refd.SquareDistance());
}
else {
Error = RealLast();
}
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
problematic_point = pref ;
Status = Standard_False ;
if (refd.IsDone()) {
Error = sqrt (refd.SquareDistance());
}
else {
Error = RealLast();
}
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
//goto FINISH ;
}
otherd.Perform(pref,oprm);
if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol) {
problematic_point = pref ;
Status = Standard_False ;
if (otherd.IsDone()) {
Error = sqrt (otherd.SquareDistance());
}
else {
Error = RealLast();
}
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
//goto FINISH ;
problematic_point = pref ;
Status = Standard_False ;
if (otherd.IsDone()) {
Error = sqrt (otherd.SquareDistance());
}
else {
Error = RealLast();
}
PrintProblematicPoint(problematic_point, Error, Tol);
return Status;
//goto FINISH ;
}
}
}
return Status ;
}
//=======================================================================
//function : Prec
//purpose :
//=======================================================================
Standard_Real Prec(const Adaptor3d_Curve& aAC3D,
const Adaptor3d_CurveOnSurface& aACS)
const Adaptor3d_CurveOnSurface& aACS)
{
Standard_Real aXEmax, aXC, aXS;
//
@@ -830,11 +835,11 @@ Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D)
aXEmax=-1.;
for (i=0; i<5; ++i) {
if (aX[i]<0.) {
aX[i]=-aX[i];
aX[i]=-aX[i];
}
aXE=Epsilon(aX[i]);
if (aXE>aXEmax) {
aXEmax=aXE;
aXEmax=aXE;
}
}
}//if (aCT=GeomAbs_Ellipse) {
@@ -864,11 +869,11 @@ Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS)
aXEmax=-1.;
for (i=0; i<4; ++i) {
if (aX[i]<0.) {
aX[i]=-aX[i];
aX[i]=-aX[i];
}
aXE=Epsilon(aX[i]);
if (aXE>aXEmax) {
aXEmax=aXE;
aXEmax=aXE;
}
}
}//if (aST==GeomAbs_Cone) {
@@ -880,8 +885,8 @@ Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS)
//=======================================================================
#ifdef OCCT_DEBUG
void PrintProblematicPoint(const gp_Pnt& problematic_point,
const Standard_Real Error,
const Standard_Real Tol)
const Standard_Real Error,
const Standard_Real Tol)
{
cout << " **** probleme de SameParameter au point :" << endl;
cout << " " << problematic_point.Coord(1) << " "
@@ -890,8 +895,8 @@ void PrintProblematicPoint(const gp_Pnt& problematic_point,
}
#else
void PrintProblematicPoint(const gp_Pnt&,
const Standard_Real,
const Standard_Real)
const Standard_Real,
const Standard_Real)
{
}
#endif

View File

@@ -50,15 +50,7 @@ is
-- face described by <F>.
is static;
Create(F : in out FaceExplorer from BRepClass;
P : Pnt from gp; Tol : Real)
returns FaceClassifier from BRepClass;
---Purpose: Creates an algorithm to classify the Point P with
-- Tolerance <T> on the face described by <F>.
Create(F : Face from TopoDS;
P : Pnt from gp; Tol : Real)
returns FaceClassifier from BRepClass;

View File

@@ -23,6 +23,10 @@
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
static const Standard_Real Probing_Start = 0.123;
static const Standard_Real Probing_End = 0.7;
static const Standard_Real Probing_Step = 0.2111;
//=======================================================================
//function : BRepClass_FaceExplorer
//purpose :
@@ -31,7 +35,7 @@
BRepClass_FaceExplorer::BRepClass_FaceExplorer(const TopoDS_Face& F) :
myFace(F),
myCurEdgeInd(1),
myCurEdgePar(0.123)
myCurEdgePar(Probing_Start)
{
myFace.Orientation(TopAbs_FORWARD);
}
@@ -56,7 +60,7 @@ Standard_Boolean BRepClass_FaceExplorer::Segment(const gp_Pnt2d& P,
Standard_Real& Par)
{
myCurEdgeInd = 1;
myCurEdgePar = 0.123;
myCurEdgePar = Probing_Start;
return OtherSegment(P, L, Par);
}
@@ -75,7 +79,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
Standard_Real aFPar;
Standard_Real aLPar;
Handle(Geom2d_Curve) aC2d;
Standard_Real aTolParConf = Precision::PConfusion();
Standard_Real aTolParConf2 = Precision::PConfusion() * Precision::PConfusion();
gp_Pnt2d aPOnC;
Standard_Real aParamIn;
@@ -103,32 +107,51 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
} else if (Precision::IsPositiveInfinite(aLPar))
aLPar = aFPar + 1.;
for (; myCurEdgePar < 0.7 ;myCurEdgePar += 0.2111) {
for (; myCurEdgePar < Probing_End ;myCurEdgePar += Probing_Step) {
aParamIn = myCurEdgePar*aFPar + (1. - myCurEdgePar)*aLPar;
aC2d->D0(aParamIn, aPOnC);
Par = aPOnC.Distance(P);
gp_Vec2d aTanVec;
aC2d->D1(aParamIn, aPOnC, aTanVec);
Par = aPOnC.SquareDistance(P);
if (Par > aTolParConf) {
if (Par > aTolParConf2) {
gp_Vec2d aLinVec(P, aPOnC);
gp_Dir2d aLinDir(aLinVec);
Standard_Real aTanMod = aTanVec.SquareMagnitude();
if (aTanMod < aTolParConf2)
continue;
aTanVec /= Sqrt(aTanMod);
Standard_Real aSinA = aTanVec.Crossed(aLinDir.XY());
const Standard_Real SmallAngle = 0.001;
if (Abs(aSinA) < SmallAngle)
{
// The line from the input point P to the current point on edge
// is tangent to the edge curve. This condition is bad for classification.
// Therefore try to go to another point in the hope that there will be
// no tangent. If there tangent is preserved then leave the last point in
// order to get this edge chanse to participate in classification.
if (myCurEdgePar + Probing_Step < Probing_End)
continue;
}
L = gp_Lin2d(P, aLinDir);
// Check if ends of a curve lie on a line.
aC2d->D0(aFPar, aPOnC);
if (L.Distance(aPOnC) > aTolParConf) {
if (L.SquareDistance(aPOnC) > aTolParConf2) {
aC2d->D0(aLPar, aPOnC);
if (L.Distance(aPOnC) > aTolParConf) {
myCurEdgePar += 0.2111;
if (L.SquareDistance(aPOnC) > aTolParConf2) {
myCurEdgePar += Probing_Step;
if (myCurEdgePar >= 0.7) {
if (myCurEdgePar >= Probing_End) {
myCurEdgeInd++;
myCurEdgePar = 0.123;
myCurEdgePar = Probing_Start;
}
Par = Sqrt(Par);
return Standard_True;
}
}
@@ -139,7 +162,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
// This curve is not valid for line construction. Go to another edge.
myCurEdgeInd++;
myCurEdgePar = 0.123;
myCurEdgePar = Probing_Start;
}
// nothing found, return an horizontal line

View File

@@ -0,0 +1,48 @@
// Created on: 2015-05-07
// Created by: Denis BOGOLEPOV
// Copyright (c) 2015 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 _BRepExtrema_ElementFilter_HeaderFile
#define _BRepExtrema_ElementFilter_HeaderFile
#include <Standard_TypeDef.hxx>
//! Filtering tool used to detect if two given mesh elements
//! should be tested for overlapping/intersection or not.
struct BRepExtrema_ElementFilter
{
//! Result of filtering function.
enum FilterResult
{
NoCheck,
Overlap,
DoCheck
};
//! Releases resources of element filter.
virtual ~BRepExtrema_ElementFilter()
{
//
}
//! Checks if two mesh elements should be tested for overlapping/intersection
//! (used for detection correct/incorrect cases of shared edges and vertices).
virtual FilterResult PreCheckElements (const Standard_Integer /*theIndex1*/,
const Standard_Integer /*theIndex2*/)
{
return DoCheck;
}
};
#endif // _BRepExtrema_ElementFilter_HeaderFile

View File

@@ -1,5 +1,6 @@
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
// Created on: 2015-05-13
// Created by: Denis BOGOLEPOV
// Copyright (c) 2015 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -12,12 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math_Memory.hxx>
#include <NCollection_DataMap.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
void *reverse_move(void *s1, void *s2, int size) {
for(int i = size - 1; i >= 0; i--) {
*((char *)s1 + i) = *((char *)s2 + i);
}
return s1;
}
//! Set of overlapped sub-shapes.
typedef NCollection_DataMap<Standard_Integer, TColStd_PackedMapOfInteger> BRepExtrema_MapOfIntegerPackedMapOfInteger;

View File

@@ -0,0 +1,831 @@
// Created on: 2015-04-26
// Created by: Denis BOGOLEPOV
// Copyright (c) 2015 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 <Precision.hxx>
#include <BRepExtrema_OverlapTool.hxx>
//=======================================================================
//function : BRepExtrema_OverlapTool
//purpose :
//=======================================================================
BRepExtrema_OverlapTool::BRepExtrema_OverlapTool()
: myFilter (NULL)
{
myIsDone = Standard_False;
}
//=======================================================================
//function : BRepExtrema_OverlapTool
//purpose :
//=======================================================================
BRepExtrema_OverlapTool::BRepExtrema_OverlapTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2)
: myFilter (NULL)
{
LoadTriangleSets (theSet1, theSet2);
}
//=======================================================================
//function : LoadTriangleSets
//purpose :
//=======================================================================
void BRepExtrema_OverlapTool::LoadTriangleSets (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2)
{
mySet1 = theSet1;
mySet2 = theSet2;
myIsDone = Standard_False;
}
#ifndef DBL_EPSILON
#define DBL_EPSILON std::numeric_limits<Standard_Real>::epsilon()
#endif
namespace
{
//! Tool class to describe stack item in traverse function.
struct BRepExtrema_StackItem
{
Standard_Integer Node1;
Standard_Integer Node2;
BRepExtrema_StackItem (const Standard_Integer theNode1 = 0,
const Standard_Integer theNode2 = 0)
: Node1 (theNode1),
Node2 (theNode2)
{
//
}
};
//! Bounding triangular prism for specified triangle.
class BRepExtrema_BoundingPrism
{
public:
//! Vertices of the prism.
BVH_Vec3d Vertices[6];
//! Edges of the prism.
BVH_Vec3d Edges[3];
//! Normal to prism caps.
BVH_Vec3d Normal;
//! Normals to prism edges.
BVH_Vec3d EdgeNormals[3];
//! Is prism initialized?
Standard_Boolean IsInited;
public:
//! Creates uninitialized bounding prism.
BRepExtrema_BoundingPrism() : IsInited (Standard_False)
{
//
}
//! Creates new bounding prism for the given triangle.
BRepExtrema_BoundingPrism (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Real theDeflect)
{
Init (theVertex0,
theVertex1,
theVertex2,
theDeflect);
}
//! Calculates bounding prism for the given triangle.
void Init (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Real theDeflect)
{
Edges[0] = theVertex1 - theVertex0;
Edges[1] = theVertex2 - theVertex0;
Edges[2] = theVertex2 - theVertex1;
Normal = BVH_Vec3d::Cross (Edges[0], Edges[1]);
EdgeNormals[0] = BVH_Vec3d::Cross (Edges[0], Normal);
EdgeNormals[1] = BVH_Vec3d::Cross (Edges[1], Normal);
EdgeNormals[2] = BVH_Vec3d::Cross (Edges[2], Normal);
EdgeNormals[0] *= 1.0 / Max (EdgeNormals[0].Modulus(), Precision::Confusion());
EdgeNormals[1] *= 1.0 / Max (EdgeNormals[1].Modulus(), Precision::Confusion());
EdgeNormals[2] *= 1.0 / Max (EdgeNormals[2].Modulus(), Precision::Confusion());
const BVH_Vec3d aDirect01 = EdgeNormals[0] - EdgeNormals[1];
const BVH_Vec3d aDirect02 = EdgeNormals[0] + EdgeNormals[2];
const BVH_Vec3d aDirect12 = EdgeNormals[2] - EdgeNormals[1];
Vertices[0] = Vertices[3] = theVertex0 + aDirect01 * (theDeflect / aDirect01.Dot (EdgeNormals[0]));
Vertices[1] = Vertices[4] = theVertex1 + aDirect02 * (theDeflect / aDirect02.Dot (EdgeNormals[2]));
Vertices[2] = Vertices[5] = theVertex2 + aDirect12 * (theDeflect / aDirect12.Dot (EdgeNormals[2]));
const BVH_Vec3d aNormOffset = Normal * (theDeflect / Max (Normal.Modulus(), Precision::Confusion()));
for (Standard_Integer aVertIdx = 0; aVertIdx < 3; ++aVertIdx)
{
Vertices[aVertIdx + 0] += aNormOffset;
Vertices[aVertIdx + 3] -= aNormOffset;
}
IsInited = Standard_True;
}
//! Checks if two prisms are separated along the given axis.
Standard_Boolean Separated (const BRepExtrema_BoundingPrism& thePrism, const BVH_Vec3d& theAxis) const
{
Standard_Real aMin1 = DBL_MAX;
Standard_Real aMax1 = -DBL_MAX;
Standard_Real aMin2 = DBL_MAX;
Standard_Real aMax2 = -DBL_MAX;
for (Standard_Integer aVertIdx = 0; aVertIdx < 6; ++aVertIdx)
{
const Standard_Real aProj1 = Vertices[aVertIdx].Dot (theAxis);
aMin1 = Min (aMin1, aProj1);
aMax1 = Max (aMax1, aProj1);
const Standard_Real aProj2 = thePrism.Vertices[aVertIdx].Dot (theAxis);
aMin2 = Min (aMin2, aProj2);
aMax2 = Max (aMax2, aProj2);
if (aMin1 <= aMax2 && aMax1 >= aMin2)
{
return Standard_False;
}
}
return aMin1 > aMax2 || aMax1 < aMin2;
}
};
// =======================================================================
// function : sign
// purpose :
// =======================================================================
Standard_Real sign (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Integer theX,
const Standard_Integer theY)
{
return (theVertex0[theX] - theVertex2[theX]) * (theVertex1[theY] - theVertex2[theY]) -
(theVertex1[theX] - theVertex2[theX]) * (theVertex0[theY] - theVertex2[theY]);
}
// =======================================================================
// function : pointInTriangle
// purpose :
// =======================================================================
Standard_Boolean pointInTriangle (const BVH_Vec3d& theTestPnt,
const BVH_Vec3d& theTrgVtx0,
const BVH_Vec3d& theTrgVtx1,
const BVH_Vec3d& theTrgVtx2,
const Standard_Integer theX,
const Standard_Integer theY)
{
const Standard_Boolean aSign0 = sign (theTestPnt, theTrgVtx0, theTrgVtx1, theX, theY) <= 0.0;
const Standard_Boolean aSign1 = sign (theTestPnt, theTrgVtx1, theTrgVtx2, theX, theY) <= 0.0;
const Standard_Boolean aSign2 = sign (theTestPnt, theTrgVtx2, theTrgVtx0, theX, theY) <= 0.0;
return (aSign0 == aSign1) && (aSign1 == aSign2);
}
// =======================================================================
// function : segmentsIntersected
// purpose : Checks if two line segments are intersected
// =======================================================================
Standard_Boolean segmentsIntersected (const BVH_Vec2d& theOriginSeg0,
const BVH_Vec2d& theOriginSeg1,
const BVH_Vec2d& theDirectSeg0,
const BVH_Vec2d& theDirectSeg1)
{
const Standard_Real aDet = -theDirectSeg1.x() * theDirectSeg0.y() +
theDirectSeg0.x() * theDirectSeg1.y();
if (fabs (aDet) < DBL_EPSILON) // segments are parallel
{
const BVH_Vec2d aDirect = theDirectSeg0 * (1.0 / theDirectSeg0.Modulus());
const Standard_Real aEdge0Time0 = theOriginSeg0.Dot (aDirect);
const Standard_Real aEdge1Time0 = theOriginSeg1.Dot (aDirect);
const Standard_Real aEdge0Time1 = aEdge0Time0 + theDirectSeg0.Dot (aDirect);
const Standard_Real aEdge1Time1 = aEdge1Time0 + theDirectSeg1.Dot (aDirect);
const Standard_Real aEdge0Min = Min (aEdge0Time0, aEdge0Time1);
const Standard_Real aEdge1Min = Min (aEdge1Time0, aEdge1Time1);
const Standard_Real aEdge0Max = Max (aEdge0Time0, aEdge0Time1);
const Standard_Real aEdge1Max = Max (aEdge1Time0, aEdge1Time1);
if (Max (aEdge0Min, aEdge1Min) > Min (aEdge0Max, aEdge1Max))
{
return Standard_False;
}
const BVH_Vec2d aNormal (-aDirect.y(), aDirect.x());
return fabs (theOriginSeg0.Dot (aNormal) - theOriginSeg1.Dot (aNormal)) < DBL_EPSILON;
}
const BVH_Vec2d aDelta = theOriginSeg0 - theOriginSeg1;
const Standard_Real aU = (-theDirectSeg0.y() * aDelta.x() + theDirectSeg0.x() * aDelta.y()) / aDet;
const Standard_Real aV = ( theDirectSeg1.x() * aDelta.y() - theDirectSeg1.y() * aDelta.x()) / aDet;
return aU >= 0.0 && aU <= 1.0 && aV >= 0.0 && aV <= 1.0;
}
// =======================================================================
// function : trianglesIntersected
// purpose : Checks if two triangles are intersected
// ("A Fast Triangle-Triangle Intersection Test" by T. Moller)
// =======================================================================
Standard_Boolean trianglesIntersected (const BVH_Vec3d& theTrng0Vert0,
const BVH_Vec3d& theTrng0Vert1,
const BVH_Vec3d& theTrng0Vert2,
const BVH_Vec3d& theTrng1Vert0,
const BVH_Vec3d& theTrng1Vert1,
const BVH_Vec3d& theTrng1Vert2)
{
const BVH_Vec3d aTrng1Normal = BVH_Vec3d::Cross (theTrng1Vert1 - theTrng1Vert0,
theTrng1Vert2 - theTrng1Vert0).Normalized();
const Standard_Real aTrng1PlaneDist = aTrng1Normal.Dot (-theTrng1Vert0);
Standard_Real aDistTrng0Vert0 = aTrng1Normal.Dot (theTrng0Vert0) + aTrng1PlaneDist;
Standard_Real aDistTrng0Vert1 = aTrng1Normal.Dot (theTrng0Vert1) + aTrng1PlaneDist;
Standard_Real aDistTrng0Vert2 = aTrng1Normal.Dot (theTrng0Vert2) + aTrng1PlaneDist;
if ((aDistTrng0Vert0 < 0.0 && aDistTrng0Vert1 < 0.0 && aDistTrng0Vert2 < 0.0)
|| (aDistTrng0Vert0 > 0.0 && aDistTrng0Vert1 > 0.0 && aDistTrng0Vert2 > 0.0))
{
return Standard_False; // 1st triangle lies on one side of the 2nd triangle
}
if (fabs (aDistTrng0Vert0) > Precision::Confusion()
|| fabs (aDistTrng0Vert1) > Precision::Confusion()
|| fabs (aDistTrng0Vert2) > Precision::Confusion()) // general 3D case
{
const BVH_Vec3d aTrng0Normal = BVH_Vec3d::Cross (theTrng0Vert1 - theTrng0Vert0,
theTrng0Vert2 - theTrng0Vert0).Normalized();
const Standard_Real aTrng0PlaneDist = aTrng0Normal.Dot (-theTrng0Vert0);
Standard_Real aDistTrng1Vert0 = aTrng0Normal.Dot (theTrng1Vert0) + aTrng0PlaneDist;
Standard_Real aDistTrng1Vert1 = aTrng0Normal.Dot (theTrng1Vert1) + aTrng0PlaneDist;
Standard_Real aDistTrng1Vert2 = aTrng0Normal.Dot (theTrng1Vert2) + aTrng0PlaneDist;
if ((aDistTrng1Vert0 < 0.0 && aDistTrng1Vert1 < 0.0 && aDistTrng1Vert2 < 0.0)
|| (aDistTrng1Vert0 > 0.0 && aDistTrng1Vert1 > 0.0 && aDistTrng1Vert2 > 0.0))
{
return Standard_False; // 2nd triangle lies on one side of the 1st triangle
}
const BVH_Vec3d aCrossLine = BVH_Vec3d::Cross (aTrng0Normal,
aTrng1Normal);
Standard_Real aProjTrng0Vert0 = theTrng0Vert0.Dot (aCrossLine);
Standard_Real aProjTrng0Vert1 = theTrng0Vert1.Dot (aCrossLine);
Standard_Real aProjTrng0Vert2 = theTrng0Vert2.Dot (aCrossLine);
if (aDistTrng0Vert0 * aDistTrng0Vert1 > 0.0)
{
std::swap (aDistTrng0Vert1, aDistTrng0Vert2);
std::swap (aProjTrng0Vert1, aProjTrng0Vert2);
}
else if (aDistTrng0Vert1 * aDistTrng0Vert2 > 0.0)
{
std::swap (aDistTrng0Vert1, aDistTrng0Vert0);
std::swap (aProjTrng0Vert1, aProjTrng0Vert0);
}
Standard_Real aTime1 = fabs (aDistTrng0Vert0) <= DBL_EPSILON ? aProjTrng0Vert0 :
aProjTrng0Vert0 + (aProjTrng0Vert1 - aProjTrng0Vert0) * aDistTrng0Vert0 / (aDistTrng0Vert0 - aDistTrng0Vert1);
Standard_Real aTime2 = fabs (aDistTrng0Vert2) <= DBL_EPSILON ? aProjTrng0Vert2 :
aProjTrng0Vert2 + (aProjTrng0Vert1 - aProjTrng0Vert2) * aDistTrng0Vert2 / (aDistTrng0Vert2 - aDistTrng0Vert1);
const Standard_Real aTimeMin1 = Min (aTime1, aTime2);
const Standard_Real aTimeMax1 = Max (aTime1, aTime2);
Standard_Real aProjTrng1Vert0 = theTrng1Vert0.Dot (aCrossLine);
Standard_Real aProjTrng1Vert1 = theTrng1Vert1.Dot (aCrossLine);
Standard_Real aProjTrng1Vert2 = theTrng1Vert2.Dot (aCrossLine);
if (aDistTrng1Vert0 * aDistTrng1Vert1 > 0.0)
{
std::swap (aDistTrng1Vert1, aDistTrng1Vert2);
std::swap (aProjTrng1Vert1, aProjTrng1Vert2);
}
else if (aDistTrng1Vert1 * aDistTrng1Vert2 > 0.0)
{
std::swap (aDistTrng1Vert1, aDistTrng1Vert0);
std::swap (aProjTrng1Vert1, aProjTrng1Vert0);
}
aTime1 = fabs (aDistTrng1Vert0) <= DBL_EPSILON ? aProjTrng1Vert0 :
aProjTrng1Vert0 + (aProjTrng1Vert1 - aProjTrng1Vert0) * aDistTrng1Vert0 / (aDistTrng1Vert0 - aDistTrng1Vert1);
aTime2 = fabs (aDistTrng1Vert2) <= DBL_EPSILON ? aProjTrng1Vert2 :
aProjTrng1Vert2 + (aProjTrng1Vert1 - aProjTrng1Vert2) * aDistTrng1Vert2 / (aDistTrng1Vert2 - aDistTrng1Vert1);
const Standard_Real aTimeMin2 = Min (aTime1, aTime2);
const Standard_Real aTimeMax2 = Max (aTime1, aTime2);
aTime1 = Max (aTimeMin1, aTimeMin2);
aTime2 = Min (aTimeMax1, aTimeMax2);
return aTime1 <= aTime2; // intervals intersected --> triangles overlapped
}
else // triangles are co-planar
{
Standard_Integer anX;
Standard_Integer anY;
if (fabs (aTrng1Normal[0]) > fabs (aTrng1Normal[1]))
{
anX = fabs (aTrng1Normal[0]) > fabs (aTrng1Normal[2]) ? 1 : 0;
anY = fabs (aTrng1Normal[0]) > fabs (aTrng1Normal[2]) ? 2 : 1;
}
else
{
anX = fabs (aTrng1Normal[1]) > fabs (aTrng1Normal[2]) ? 0 : 0;
anY = fabs (aTrng1Normal[1]) > fabs (aTrng1Normal[2]) ? 2 : 1;
}
const BVH_Vec2d aOriginSeg0 [] = {BVH_Vec2d (theTrng0Vert0[anX], theTrng0Vert0[anY]),
BVH_Vec2d (theTrng0Vert1[anX], theTrng0Vert1[anY]),
BVH_Vec2d (theTrng0Vert2[anX], theTrng0Vert2[anY]) };
const BVH_Vec2d aDirectSeg0 [] = {aOriginSeg0[1] - aOriginSeg0[0],
aOriginSeg0[2] - aOriginSeg0[1],
aOriginSeg0[0] - aOriginSeg0[2] };
const BVH_Vec2d aOriginSeg1 [] = {BVH_Vec2d (theTrng1Vert0[anX], theTrng1Vert0[anY]),
BVH_Vec2d (theTrng1Vert1[anX], theTrng1Vert1[anY]),
BVH_Vec2d (theTrng1Vert2[anX], theTrng1Vert2[anY]) };
const BVH_Vec2d aDirectSeg1 [] = {aOriginSeg1[1] - aOriginSeg1[0],
aOriginSeg1[2] - aOriginSeg1[1],
aOriginSeg1[0] - aOriginSeg1[2] };
for (Standard_Integer aTrg0Edge = 0; aTrg0Edge < 3; ++aTrg0Edge)
{
for (Standard_Integer aTrg1Edge = 0; aTrg1Edge < 3; ++aTrg1Edge)
{
if (segmentsIntersected (aOriginSeg0[aTrg0Edge],
aOriginSeg1[aTrg1Edge],
aDirectSeg0[aTrg0Edge],
aDirectSeg1[aTrg1Edge]))
{
return Standard_True; // edges intersected --> triangles overlapped
}
}
}
if (pointInTriangle (theTrng1Vert0,
theTrng0Vert0,
theTrng0Vert1,
theTrng0Vert2,
anX,
anY))
{
return Standard_True; // 1st triangle inside 2nd --> triangles overlapped
}
if (pointInTriangle (theTrng0Vert0,
theTrng1Vert0,
theTrng1Vert1,
theTrng1Vert2,
anX,
anY))
{
return Standard_True; // 2nd triangle inside 1st --> triangles overlapped
}
}
return Standard_False;
}
// =======================================================================
// function : prismsIntersected
// purpose : Checks if two triangular prisms are intersected
// (test uses SAT - Separating Axis Theorem)
// =======================================================================
Standard_Boolean prismsIntersected (const BRepExtrema_BoundingPrism& thePrism1,
const BRepExtrema_BoundingPrism& thePrism2)
{
if (thePrism1.Separated (thePrism2, thePrism1.Normal))
{
return Standard_False;
}
if (thePrism1.Separated (thePrism2, thePrism2.Normal))
{
return Standard_False;
}
for (Standard_Integer anIdx = 0; anIdx < 3; ++anIdx)
{
if (thePrism1.Separated (thePrism2, thePrism1.EdgeNormals[anIdx]))
{
return Standard_False;
}
}
for (Standard_Integer anIdx = 0; anIdx < 3; ++anIdx)
{
if (thePrism1.Separated (thePrism2, thePrism2.EdgeNormals[anIdx]))
{
return Standard_False;
}
}
for (Standard_Integer anIdx1 = 0; anIdx1 < 4; ++anIdx1)
{
const BVH_Vec3d& aEdge1 = (anIdx1 == 3) ? thePrism1.Normal : thePrism1.Edges[anIdx1];
for (Standard_Integer anIdx2 = 0; anIdx2 < 4; ++anIdx2)
{
const BVH_Vec3d& aEdge2 = (anIdx2 == 3) ? thePrism2.Normal : thePrism2.Edges[anIdx2];
if (thePrism1.Separated (thePrism2, BVH_Vec3d::Cross (aEdge1, aEdge2)))
{
return Standard_False;
}
}
}
return Standard_True;
}
// =======================================================================
// function : overlapBoxes
// purpose : Checks if two boxes (AABBs) are overlapped
// =======================================================================
inline Standard_Boolean overlapBoxes (const BVH_Vec3d& theBoxMin1,
const BVH_Vec3d& theBoxMax1,
const BVH_Vec3d& theBoxMin2,
const BVH_Vec3d& theBoxMax2,
const Standard_Real theTolerance)
{
// Check for overlap
return !(theBoxMin1.x() > theBoxMax2.x() + theTolerance ||
theBoxMax1.x() < theBoxMin2.x() - theTolerance ||
theBoxMin1.y() > theBoxMax2.y() + theTolerance ||
theBoxMax1.y() < theBoxMin2.y() - theTolerance ||
theBoxMin1.z() > theBoxMax2.z() + theTolerance ||
theBoxMax1.z() < theBoxMin2.z() - theTolerance);
}
//=======================================================================
//function : getSetOfFaces
//purpose :
//=======================================================================
TColStd_PackedMapOfInteger& getSetOfFaces (
BRepExtrema_MapOfIntegerPackedMapOfInteger& theFaces, const Standard_Integer theFaceIdx)
{
if (!theFaces.IsBound (theFaceIdx))
{
theFaces.Bind (theFaceIdx, TColStd_PackedMapOfInteger());
}
return theFaces.ChangeFind (theFaceIdx);
}
}
//=======================================================================
//function : intersectTriangleRangesExact
//purpose :
//=======================================================================
void BRepExtrema_OverlapTool::intersectTriangleRangesExact (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2)
{
for (Standard_Integer aTrgIdx1 = theLeaf1.y(); aTrgIdx1 <= theLeaf1.z(); ++aTrgIdx1)
{
const Standard_Integer aFaceIdx1 = mySet1->GetFaceID (aTrgIdx1);
BVH_Vec3d aTrg1Vert1;
BVH_Vec3d aTrg1Vert2;
BVH_Vec3d aTrg1Vert3;
mySet1->GetVertices (aTrgIdx1,
aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3);
const Standard_Boolean aIsInSet = myOverlapSubShapes1.IsBound (aFaceIdx1);
for (Standard_Integer aTrgIdx2 = theLeaf2.y(); aTrgIdx2 <= theLeaf2.z(); ++aTrgIdx2)
{
const Standard_Integer aFaceIdx2 = mySet2->GetFaceID (aTrgIdx2);
if (aIsInSet && myOverlapSubShapes1.Find (aFaceIdx1).Contains (aFaceIdx2))
{
continue;
}
BRepExtrema_ElementFilter::FilterResult aResult = myFilter == NULL ?
BRepExtrema_ElementFilter::DoCheck : myFilter->PreCheckElements (aTrgIdx1, aTrgIdx2);
if (aResult == BRepExtrema_ElementFilter::Overlap)
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
if (mySet1 == mySet2)
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles1.Add (aTrgIdx2);
}
else
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles2.Add (aTrgIdx2);
}
#endif
}
else if (aResult == BRepExtrema_ElementFilter::DoCheck)
{
BVH_Vec3d aTrg2Vert1;
BVH_Vec3d aTrg2Vert2;
BVH_Vec3d aTrg2Vert3;
mySet2->GetVertices (aTrgIdx2, aTrg2Vert1, aTrg2Vert2, aTrg2Vert3);
if (trianglesIntersected (aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3,
aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3))
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
if (mySet1 == mySet2)
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles1.Add (aTrgIdx2);
}
else
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles2.Add (aTrgIdx2);
}
#endif
}
}
}
}
}
//=======================================================================
//function : intersectTriangleRangesToler
//purpose :
//=======================================================================
void BRepExtrema_OverlapTool::intersectTriangleRangesToler (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2,
const Standard_Real theToler)
{
for (Standard_Integer aTrgIdx1 = theLeaf1.y(); aTrgIdx1 <= theLeaf1.z(); ++aTrgIdx1)
{
const Standard_Integer aFaceIdx1 = mySet1->GetFaceID (aTrgIdx1);
BVH_Vec3d aTrg1Vert1;
BVH_Vec3d aTrg1Vert2;
BVH_Vec3d aTrg1Vert3;
mySet1->GetVertices (aTrgIdx1,
aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3);
BRepExtrema_BoundingPrism aPrism1; // not initialized
const Standard_Boolean aIsInSet = myOverlapSubShapes1.IsBound (aFaceIdx1);
for (Standard_Integer aTrgIdx2 = theLeaf2.y(); aTrgIdx2 <= theLeaf2.z(); ++aTrgIdx2)
{
const Standard_Integer aFaceIdx2 = mySet2->GetFaceID (aTrgIdx2);
if (aIsInSet && myOverlapSubShapes1.Find (aFaceIdx1).Contains (aFaceIdx2))
{
continue;
}
BRepExtrema_ElementFilter::FilterResult aResult = myFilter == NULL ?
BRepExtrema_ElementFilter::DoCheck : myFilter->PreCheckElements (aTrgIdx1, aTrgIdx2);
if (aResult == BRepExtrema_ElementFilter::Overlap)
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
if (mySet1 == mySet2)
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles1.Add (aTrgIdx2);
}
else
{
myOverlapTriangles1.Add (aTrgIdx1);
myOverlapTriangles2.Add (aTrgIdx2);
}
#endif
}
else if (aResult == BRepExtrema_ElementFilter::DoCheck)
{
if (!aPrism1.IsInited)
{
aPrism1.Init (aTrg1Vert1, aTrg1Vert2, aTrg1Vert3, theToler);
}
BVH_Vec3d aTrg2Vert1;
BVH_Vec3d aTrg2Vert2;
BVH_Vec3d aTrg2Vert3;
mySet2->GetVertices (aTrgIdx2,
aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3);
BRepExtrema_BoundingPrism aPrism2 (aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3,
theToler);
if (prismsIntersected (aPrism1, aPrism2))
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
}
}
}
}
}
//=======================================================================
//function : Perform
//purpose : Performs search for overlapped faces
//=======================================================================
void BRepExtrema_OverlapTool::Perform (const Standard_Real theTolerance)
{
if (mySet1.IsNull() || mySet2.IsNull())
{
return;
}
BRepExtrema_StackItem aStack[96];
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& aBVH1 = mySet1->BVH();
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& aBVH2 = mySet2->BVH();
if (aBVH1.IsNull() || aBVH2.IsNull())
{
return;
}
BRepExtrema_StackItem aNodes; // current pair of nodes
Standard_Integer aHead = -1; // stack head position
for (;;)
{
BVH_Vec4i aNodeData1 = aBVH1->NodeInfoBuffer()[aNodes.Node1];
BVH_Vec4i aNodeData2 = aBVH2->NodeInfoBuffer()[aNodes.Node2];
if (aNodeData1.x() != 0 && aNodeData2.x() != 0) // leaves
{
if (theTolerance == 0.0)
{
intersectTriangleRangesExact (aNodeData1, aNodeData2);
}
else
{
intersectTriangleRangesToler (aNodeData1, aNodeData2, theTolerance);
}
if (aHead < 0)
break;
aNodes = aStack[aHead--];
}
else
{
BRepExtrema_StackItem aPairsToProcess[4];
Standard_Integer aNbPairs = 0;
if (aNodeData1.x() == 0) // inner node
{
const BVH_Vec3d& aMinPntLft1 = aBVH1->MinPoint (aNodeData1.y());
const BVH_Vec3d& aMaxPntLft1 = aBVH1->MaxPoint (aNodeData1.y());
const BVH_Vec3d& aMinPntRgh1 = aBVH1->MinPoint (aNodeData1.z());
const BVH_Vec3d& aMaxPntRgh1 = aBVH1->MaxPoint (aNodeData1.z());
if (aNodeData2.x() == 0) // inner node
{
const BVH_Vec3d& aMinPntLft2 = aBVH2->MinPoint (aNodeData2.y());
const BVH_Vec3d& aMaxPntLft2 = aBVH2->MaxPoint (aNodeData2.y());
const BVH_Vec3d& aMinPntRgh2 = aBVH2->MinPoint (aNodeData2.z());
const BVH_Vec3d& aMaxPntRgh2 = aBVH2->MaxPoint (aNodeData2.z());
if (overlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntLft2, aMaxPntLft2, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodeData2.y());
}
if (overlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntRgh2, aMaxPntRgh2, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodeData2.z());
}
if (overlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntLft2, aMaxPntLft2, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodeData2.y());
}
if (overlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntRgh2, aMaxPntRgh2, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodeData2.z());
}
}
else
{
const BVH_Vec3d& aMinPntLeaf = aBVH2->MinPoint (aNodes.Node2);
const BVH_Vec3d& aMaxPntLeaf = aBVH2->MaxPoint (aNodes.Node2);
if (overlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntLeaf, aMaxPntLeaf, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodes.Node2);
}
if (overlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntLeaf, aMaxPntLeaf, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodes.Node2);
}
}
}
else
{
const BVH_Vec3d& aMinPntLeaf = aBVH1->MinPoint (aNodes.Node1);
const BVH_Vec3d& aMaxPntLeaf = aBVH1->MaxPoint (aNodes.Node1);
const BVH_Vec3d& aMinPntLft2 = aBVH2->MinPoint (aNodeData2.y());
const BVH_Vec3d& aMaxPntLft2 = aBVH2->MaxPoint (aNodeData2.y());
const BVH_Vec3d& aMinPntRgh2 = aBVH2->MinPoint (aNodeData2.z());
const BVH_Vec3d& aMaxPntRgh2 = aBVH2->MaxPoint (aNodeData2.z());
if (overlapBoxes (aMinPntLft2, aMaxPntLft2, aMinPntLeaf, aMaxPntLeaf, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodes.Node1, aNodeData2.y());
}
if (overlapBoxes (aMinPntRgh2, aMaxPntRgh2, aMinPntLeaf, aMaxPntLeaf, theTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodes.Node1, aNodeData2.z());
}
}
if (aNbPairs > 0)
{
aNodes = aPairsToProcess[0];
for (Standard_Integer anIdx = 1; anIdx < aNbPairs; ++anIdx)
{
aStack[++aHead] = aPairsToProcess[anIdx];
}
}
else
{
if (aHead < 0)
break;
aNodes = aStack[aHead--];
}
}
}
myIsDone = Standard_True;
}

View File

@@ -0,0 +1,118 @@
// Created on: 2015-04-26
// Created by: Denis BOGOLEPOV
// Copyright (c) 2015 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 _BRepExtrema_OverlapTool_HeaderFile
#define _BRepExtrema_OverlapTool_HeaderFile
#include <BVH_Geometry.hxx>
#include <BRepExtrema_TriangleSet.hxx>
#include <BRepExtrema_ElementFilter.hxx>
#include <BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx>
//! Enables storing of individual overlapped triangles (useful for debug).
// #define OVERLAP_TOOL_OUTPUT_TRIANGLES
//! Tool class for for detection of overlapping of two BVH primitive sets.
//! This tool is not intended to be used independently, and is integrated
//! in other classes, implementing algorithms based on shape tessellation
//! (BRepExtrema_ShapeProximity and BRepExtrema_SelfIntersection).
//!
//! Note that input element sets may correspond to different shapes or to
//! the same shape. In first case, tessellations of two given shapes will
//! be tested for intersection (or overlapping, if tolerance is not zero).
//! In second case, tessellation of single shape will be tested for self-
//! intersections. Please note that algorithm results are approximate and
//! depend greatly on the quality of input tessellation(s).
class BRepExtrema_OverlapTool
{
public:
//! Creates new unitialized overlap tool.
BRepExtrema_OverlapTool();
//! Creates new overlap tool for the given element sets.
BRepExtrema_OverlapTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2);
public:
//! Loads the given element sets into the overlap tool.
void LoadTriangleSets (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2);
//! Performs searching of overlapped mesh elements.
void Perform (const Standard_Real theTolerance = 0.0);
//! Is overlap test completed?
Standard_Boolean IsDone() const { return myIsDone; }
//! Marks test results as outdated.
void MarkDirty() { myIsDone = Standard_False; }
//! Returns set of overlapped sub-shapes of 1st shape (currently only faces are detected).
const BRepExtrema_MapOfIntegerPackedMapOfInteger& OverlapSubShapes1() const { return myOverlapSubShapes1; }
//! Returns set of overlapped sub-shapes of 2nd shape (currently only faces are detected).
const BRepExtrema_MapOfIntegerPackedMapOfInteger& OverlapSubShapes2() const { return myOverlapSubShapes2; }
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
//! Returns set of overlapped triangles from the 1st shape (for debug).
const TColStd_PackedMapOfInteger& OverlapTriangles1() const { return myOverlapTriangles1; }
//! Returns set of overlapped triangles from the 2nd shape (for debug).
const TColStd_PackedMapOfInteger& OverlapTriangles2() const { return myOverlapTriangles2; }
#endif
//! Sets filtering tool for preliminary checking pairs of mesh elements.
void SetElementFilter (BRepExtrema_ElementFilter* theFilter) { myFilter = theFilter; }
protected:
//! Performs narrow-phase of overlap test (exact intersection).
void intersectTriangleRangesExact (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2);
//! Performs narrow-phase of overlap test (intersection with non-zero tolerance).
void intersectTriangleRangesToler (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2,
const Standard_Real theToler);
private:
//! Set of all mesh elements (triangles) of the 1st shape.
Handle(BRepExtrema_TriangleSet) mySet1;
//! Set of all mesh elements (triangles) of the 2nd shape.
Handle(BRepExtrema_TriangleSet) mySet2;
//! Filter for preliminary checking pairs of mesh elements.
BRepExtrema_ElementFilter* myFilter;
//! Resulted set of overlapped sub-shapes of 1st shape (only faces).
BRepExtrema_MapOfIntegerPackedMapOfInteger myOverlapSubShapes1;
//! Resulted set of overlapped sub-shapes of 2nd shape (only faces).
BRepExtrema_MapOfIntegerPackedMapOfInteger myOverlapSubShapes2;
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
//! Set of overlapped elements from the 1st shape (only triangles).
TColStd_PackedMapOfInteger myOverlapTriangles1;
//! Set of overlapped elements from the 2nd shape (only triangles).
TColStd_PackedMapOfInteger myOverlapTriangles2;
#endif
//! Is overlap test test completed?
Standard_Boolean myIsDone;
};
#endif // _BRepExtrema_OverlapTool_HeaderFile

View File

@@ -0,0 +1,312 @@
// Created on: 2015-04-26
// Created by: Denis BOGOLEPOV
// Copyright (c) 2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepExtrema_SelfIntersection.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
//=======================================================================
//function : BRepExtrema_SelfIntersection
//purpose :
//=======================================================================
BRepExtrema_SelfIntersection::BRepExtrema_SelfIntersection (const Standard_Real theTolerance)
: myTolerance (theTolerance)
{
myIsInit = Standard_False;
}
//=======================================================================
//function : BRepExtrema_SelfIntersection
//purpose :
//=======================================================================
BRepExtrema_SelfIntersection::BRepExtrema_SelfIntersection (const TopoDS_Shape& theShape, const Standard_Real theTolerance)
: myTolerance (theTolerance)
{
LoadShape (theShape);
}
//=======================================================================
//function : LoadShape
//purpose :
//=======================================================================
Standard_Boolean BRepExtrema_SelfIntersection::LoadShape (const TopoDS_Shape& theShape)
{
myFaceList.Clear();
for (TopExp_Explorer anIter (theShape, TopAbs_FACE); anIter.More(); anIter.Next())
{
myFaceList.Append (static_cast<const TopoDS_Face&> (anIter.Current()));
}
if (myElementSet.IsNull())
{
myElementSet = new BRepExtrema_TriangleSet;
}
myIsInit = myElementSet->Init (myFaceList);
if (myIsInit)
{
myOverlapTool.LoadTriangleSets (myElementSet,
myElementSet);
}
return myIsInit;
}
#define ZERO_VEC BVH_Vec3d (0.0, 0.0, 0.0)
namespace
{
// =======================================================================
// function : ccw
// purpose : Check if triple is in counterclockwise order
// =======================================================================
Standard_Boolean ccw (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Integer theX,
const Standard_Integer theY)
{
const Standard_Real aSum =
(theVertex1[theX] - theVertex0[theX]) * (theVertex1[theY] + theVertex0[theY]) +
(theVertex2[theX] - theVertex1[theX]) * (theVertex2[theY] + theVertex1[theY]) +
(theVertex0[theX] - theVertex2[theX]) * (theVertex0[theY] + theVertex2[theY]);
return aSum < 0.0;
}
// =======================================================================
// function : rayInsideAngle
// purpose : Check the given ray is inside the angle
// =======================================================================
Standard_Boolean rayInsideAngle (const BVH_Vec3d& theDirec,
const BVH_Vec3d& theEdge0,
const BVH_Vec3d& theEdge1,
const Standard_Integer theX,
const Standard_Integer theY)
{
const Standard_Boolean aCCW = ccw (ZERO_VEC, theEdge0, theEdge1, theX, theY);
return ccw (ZERO_VEC, theEdge0, theDirec, theX, theY) == aCCW
&& ccw (ZERO_VEC, theDirec, theEdge1, theX, theY) == aCCW;
}
// =======================================================================
// function : getProjectionAxes
// purpose :
// =======================================================================
void getProjectionAxes (const BVH_Vec3d& theNorm,
Standard_Integer& theAxisX,
Standard_Integer& theAxisY)
{
if (fabs (theNorm[0]) > fabs (theNorm[1]))
{
theAxisX = fabs (theNorm[0]) > fabs (theNorm[2]) ? 1 : 0;
theAxisY = fabs (theNorm[0]) > fabs (theNorm[2]) ? 2 : 1;
}
else
{
theAxisX = fabs (theNorm[1]) > fabs (theNorm[2]) ? 0 : 0;
theAxisY = fabs (theNorm[1]) > fabs (theNorm[2]) ? 2 : 1;
}
}
}
//=======================================================================
//function : isRegularSharedVertex
//purpose :
//=======================================================================
BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularSharedVertex (const BVH_Vec3d& theSharedVert,
const BVH_Vec3d& theTrng0Vtxs1,
const BVH_Vec3d& theTrng0Vtxs2,
const BVH_Vec3d& theTrng1Vtxs1,
const BVH_Vec3d& theTrng1Vtxs2)
{
const BVH_Vec3d aTrng0Edges[] = { (theTrng0Vtxs1 - theSharedVert).Normalized(),
(theTrng0Vtxs2 - theSharedVert).Normalized() };
const BVH_Vec3d aTrng1Edges[] = { (theTrng1Vtxs1 - theSharedVert).Normalized(),
(theTrng1Vtxs2 - theSharedVert).Normalized() };
const BVH_Vec3d aTrng0Normal = BVH_Vec3d::Cross (aTrng0Edges[0], aTrng0Edges[1]);
const BVH_Vec3d aTrng1Normal = BVH_Vec3d::Cross (aTrng1Edges[0], aTrng1Edges[1]);
BVH_Vec3d aCrossLine = BVH_Vec3d::Cross (aTrng0Normal,
aTrng1Normal);
Standard_Integer anX;
Standard_Integer anY;
if (aCrossLine.SquareModulus() < Precision::SquareConfusion()) // coplanar case
{
getProjectionAxes (aTrng0Normal, anX, anY);
if (rayInsideAngle (aTrng1Edges[0], aTrng0Edges[0], aTrng0Edges[1], anX, anY)
|| rayInsideAngle (aTrng1Edges[1], aTrng0Edges[0], aTrng0Edges[1], anX, anY)
|| rayInsideAngle (aTrng0Edges[0], aTrng1Edges[0], aTrng1Edges[1], anX, anY)
|| rayInsideAngle (aTrng0Edges[1], aTrng1Edges[0], aTrng1Edges[1], anX, anY))
{
return BRepExtrema_ElementFilter::Overlap;
}
return BRepExtrema_ElementFilter::NoCheck;
}
else // shared line should lie outside at least one triangle
{
getProjectionAxes (aTrng0Normal, anX, anY);
const Standard_Boolean aPosOutTrgn0 = !rayInsideAngle ( aCrossLine, aTrng0Edges[0], aTrng0Edges[1], anX, anY);
const Standard_Boolean aNegOutTrgn0 = !rayInsideAngle (-aCrossLine, aTrng0Edges[0], aTrng0Edges[1], anX, anY);
Standard_ASSERT_RAISE (aPosOutTrgn0 || aNegOutTrgn0,
"Failed to detect if shared vertex is regular or not");
if (aPosOutTrgn0 && aNegOutTrgn0)
{
return BRepExtrema_ElementFilter::NoCheck;
}
getProjectionAxes (aTrng1Normal, anX, anY);
const Standard_Boolean aPosOutTrgn1 = !rayInsideAngle ( aCrossLine, aTrng1Edges[0], aTrng1Edges[1], anX, anY);
const Standard_Boolean aNegOutTrgn1 = !rayInsideAngle (-aCrossLine, aTrng1Edges[0], aTrng1Edges[1], anX, anY);
Standard_ASSERT_RAISE (aPosOutTrgn1 || aNegOutTrgn1,
"Failed to detect if shared vertex is regular or not");
if (aPosOutTrgn1 && aNegOutTrgn1)
{
return BRepExtrema_ElementFilter::NoCheck;
}
return (aPosOutTrgn0 || aPosOutTrgn1) && (aNegOutTrgn0 || aNegOutTrgn1) ?
BRepExtrema_ElementFilter::NoCheck : BRepExtrema_ElementFilter::Overlap;
}
}
//=======================================================================
//function : isRegularSharedEdge
//purpose :
//=======================================================================
BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularSharedEdge (const BVH_Vec3d& theTrng0Vtxs0,
const BVH_Vec3d& theTrng0Vtxs1,
const BVH_Vec3d& theTrng0Vtxs2,
const BVH_Vec3d& theTrng1Vtxs2)
{
const BVH_Vec3d aSharedEdge = (theTrng0Vtxs1 - theTrng0Vtxs0).Normalized();
const BVH_Vec3d aUniqueEdges[] = { (theTrng0Vtxs2 - theTrng0Vtxs0).Normalized(),
(theTrng1Vtxs2 - theTrng0Vtxs0).Normalized() };
const BVH_Vec3d aTrng0Normal = BVH_Vec3d::Cross (aSharedEdge, aUniqueEdges[0]);
const BVH_Vec3d aTrng1Normal = BVH_Vec3d::Cross (aSharedEdge, aUniqueEdges[1]);
BVH_Vec3d aCrossLine = BVH_Vec3d::Cross (aTrng0Normal,
aTrng1Normal);
if (aCrossLine.SquareModulus() > Precision::SquareConfusion()) // non-coplanar case
{
return BRepExtrema_ElementFilter::NoCheck;
}
Standard_Integer anX;
Standard_Integer anY;
getProjectionAxes (aTrng0Normal, anX, anY);
return ccw (ZERO_VEC, aSharedEdge, aUniqueEdges[0], anX, anY) !=
ccw (ZERO_VEC, aSharedEdge, aUniqueEdges[1], anX, anY) ? BRepExtrema_ElementFilter::NoCheck
: BRepExtrema_ElementFilter::Overlap;
}
//=======================================================================
//function : PreCheckElements
//purpose :
//=======================================================================
BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::PreCheckElements (const Standard_Integer theIndex1,
const Standard_Integer theIndex2)
{
if (myElementSet->GetFaceID (theIndex1) == myElementSet->GetFaceID (theIndex2))
{
return BRepExtrema_ElementFilter::NoCheck; // triangles are from the same face
}
BVH_Vec3d aTrng0Vtxs[3];
BVH_Vec3d aTrng1Vtxs[3];
myElementSet->GetVertices (theIndex1,
aTrng0Vtxs[0],
aTrng0Vtxs[1],
aTrng0Vtxs[2]);
myElementSet->GetVertices (theIndex2,
aTrng1Vtxs[0],
aTrng1Vtxs[1],
aTrng1Vtxs[2]);
std::vector<std::pair<Standard_Integer, Standard_Integer> > aSharedVtxs;
for (Standard_Integer aVertIdx1 = 0; aVertIdx1 < 3; ++aVertIdx1)
{
for (Standard_Integer aVertIdx2 = 0; aVertIdx2 < 3; ++aVertIdx2)
{
if ((aTrng0Vtxs[aVertIdx1] - aTrng1Vtxs[aVertIdx2]).SquareModulus() < Precision::SquareConfusion())
{
aSharedVtxs.push_back (std::pair<Standard_Integer, Standard_Integer> (aVertIdx1, aVertIdx2));
break; // go to next vertex of the 1st triangle
}
}
}
if (aSharedVtxs.size() == 2) // check shared edge
{
return isRegularSharedEdge (aTrng0Vtxs[aSharedVtxs[0].first],
aTrng0Vtxs[aSharedVtxs[1].first],
aTrng0Vtxs[3 - aSharedVtxs[0]. first - aSharedVtxs[1]. first],
aTrng1Vtxs[3 - aSharedVtxs[0].second - aSharedVtxs[1].second]);
}
else if (aSharedVtxs.size() == 1) // check shared vertex
{
std::swap (*aTrng0Vtxs, aTrng0Vtxs[aSharedVtxs.front(). first]);
std::swap (*aTrng1Vtxs, aTrng1Vtxs[aSharedVtxs.front().second]);
return isRegularSharedVertex (aTrng0Vtxs[0],
aTrng0Vtxs[1],
aTrng0Vtxs[2],
aTrng1Vtxs[1],
aTrng1Vtxs[2]);
}
return BRepExtrema_ElementFilter::DoCheck;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void BRepExtrema_SelfIntersection::Perform()
{
if (!myIsInit || myOverlapTool.IsDone())
{
return;
}
myOverlapTool.SetElementFilter (this);
myOverlapTool.Perform (myTolerance);
}

View File

@@ -0,0 +1,134 @@
// Created on: 2015-04-26
// Created by: Denis BOGOLEPOV
// Copyright (c) 2015 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 _BRepExtrema_SelfIntersection_HeaderFile
#define _BRepExtrema_SelfIntersection_HeaderFile
#include <BRepExtrema_OverlapTool.hxx>
//! Tool class for detection of self-sections in the given shape.
//! This class is based on BRepExtrema_OverlapTool and thus uses
//! shape tessellation to detect incorrect mesh fragments (pairs
//! of overlapped triangles belonging to different faces). Thus,
//! a result depends critically on the quality of mesh generator
//! (e.g., BREP mesh is not always a good choice, because it can
//! contain gaps between adjacent face triangulations, which may
//! not share vertices on common edge; thus false overlap can be
//! detected). As a result, this tool can be used for relatively
//! fast approximated test which provides sub-set of potentially
//! overlapped faces.
class BRepExtrema_SelfIntersection : public BRepExtrema_ElementFilter
{
friend class BRepExtrema_OverlapTool;
public:
//! Creates unitialized self-intersection tool.
Standard_EXPORT BRepExtrema_SelfIntersection (const Standard_Real theTolerance = 0.0);
//! Creates self-intersection tool for the given shape.
Standard_EXPORT BRepExtrema_SelfIntersection (const TopoDS_Shape& theShape, const Standard_Real theTolerance = 0.0);
public:
//! Returns tolerance value used for self-intersection test.
Standard_Real Tolerance() const
{
return myTolerance;
}
//! Sets tolerance value used for self-intersection test.
void SetTolerance (const Standard_Real theTolerance)
{
myTolerance = theTolerance;
}
//! Loads shape for detection of self-intersections.
Standard_EXPORT Standard_Boolean LoadShape (const TopoDS_Shape& theShape);
//! Performs detection of self-intersections.
Standard_EXPORT void Perform();
//! True if the detection is completed.
Standard_Boolean IsDone() const
{
return myOverlapTool.IsDone();
}
//! Returns set of IDs of overlapped sub-shapes (started from 0).
const BRepExtrema_MapOfIntegerPackedMapOfInteger& OverlapElements() const
{
return myOverlapTool.OverlapSubShapes1();
}
//! Returns sub-shape from the shape for the given index (started from 0).
const TopoDS_Face& GetSubShape (const Standard_Integer theID) const
{
return myFaceList.Value (theID);
}
//! Returns set of all the face triangles of the shape.
const Handle(BRepExtrema_TriangleSet)& ElementSet() const
{
return myElementSet;
}
#ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
//! Returns set of overlapped mesh elements (only triangles).
const TColStd_PackedMapOfInteger& OverlapTriangles() const
{
return myOverlapTool.OverlapTriangles1();
}
#endif
protected:
//! Filter out correct adjacent mesh elements.
virtual BRepExtrema_ElementFilter::FilterResult PreCheckElements (const Standard_Integer theIndex1,
const Standard_Integer theIndex2);
//! Checks if the given triangles have only single common vertex.
BRepExtrema_ElementFilter::FilterResult isRegularSharedVertex (const BVH_Vec3d& theSharedVert,
const BVH_Vec3d& theTrng1Vtxs1,
const BVH_Vec3d& theTrng1Vtxs2,
const BVH_Vec3d& theTrng2Vtxs1,
const BVH_Vec3d& theTrng2Vtxs2);
//! Checks if the given triangles have only single common edge.
BRepExtrema_ElementFilter::FilterResult isRegularSharedEdge (const BVH_Vec3d& theTrng1Vtxs0,
const BVH_Vec3d& theTrng1Vtxs1,
const BVH_Vec3d& theTrng1Vtxs2,
const BVH_Vec3d& theTrng2Vtxs2);
private:
//! Self-intersection tolerance.
Standard_Real myTolerance;
//! Is the input shape inited?
Standard_Boolean myIsInit;
//! List of triangulated faces of the shape.
BRepExtrema_ShapeList myFaceList;
//! Set of all the face triangles of the shape.
Handle(BRepExtrema_TriangleSet) myElementSet;
//! Overlap tool used for self-intersection test.
BRepExtrema_OverlapTool myOverlapTool;
};
#endif // _BRepExtrema_SelfIntersection_HeaderFile

View File

@@ -20,15 +20,15 @@
//=======================================================================
//function : BRepExtrema_ShapeProximity
//purpose : Creates empty proximity tool
//purpose : Creates uninitialized proximity tool
//=======================================================================
BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const Standard_Real theTolerance)
: myTolerance (theTolerance),
myPrimitiveSet1 (new BRepExtrema_TriangleSet),
myPrimitiveSet2 (new BRepExtrema_TriangleSet)
: myTolerance (theTolerance),
myElementSet1 (new BRepExtrema_TriangleSet),
myElementSet2 (new BRepExtrema_TriangleSet)
{
// Should be initialized later
myIsDone = myIsInitS1 = myIsInitS2 = Standard_False;
myIsInitS1 = myIsInitS2 = Standard_False;
}
//=======================================================================
@@ -38,9 +38,9 @@ BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const Standard_Real theT
BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const TopoDS_Shape& theShape1,
const TopoDS_Shape& theShape2,
const Standard_Real theTolerance)
: myTolerance (theTolerance),
myPrimitiveSet1 (new BRepExtrema_TriangleSet),
myPrimitiveSet2 (new BRepExtrema_TriangleSet)
: myTolerance (theTolerance),
myElementSet1 (new BRepExtrema_TriangleSet),
myElementSet2 (new BRepExtrema_TriangleSet)
{
LoadShape1 (theShape1);
LoadShape2 (theShape2);
@@ -59,9 +59,9 @@ Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 (const TopoDS_Shape& the
myFaceList1.Append (static_cast<const TopoDS_Face&> (anIter.Current()));
}
myIsDone = Standard_False;
myOverlapTool.MarkDirty();
return myIsInitS1 = myPrimitiveSet1->Init (myFaceList1);
return myIsInitS1 = myElementSet1->Init (myFaceList1);
}
//=======================================================================
@@ -77,569 +77,24 @@ Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 (const TopoDS_Shape& the
myFaceList2.Append (static_cast<const TopoDS_Face&> (anIter.Current()));
}
myIsDone = Standard_False;
myOverlapTool.MarkDirty();
return myIsInitS2 = myPrimitiveSet2->Init (myFaceList2);
}
namespace
{
//! Tool class to describe stack item in traverse function.
struct BRepExtrema_StackItem
{
Standard_Integer Node1;
Standard_Integer Node2;
BRepExtrema_StackItem (const Standard_Integer theNode1 = 0,
const Standard_Integer theNode2 = 0)
: Node1 (theNode1),
Node2 (theNode2)
{
//
}
};
//! Bounding triangular prism for specified triangle.
class BRepExtrema_BoundingPrism
{
public:
//! Vertices of the prism.
BVH_Vec3d Vertices[6];
//! Edges of the prism.
BVH_Vec3d Edges[3];
//! Normal to prism caps.
BVH_Vec3d Normal;
//! Normals to prism edges.
BVH_Vec3d EdgeNormals[3];
//! Is prism initialized?
Standard_Boolean IsInited;
public:
//! Creates uninitialized bounding prism.
BRepExtrema_BoundingPrism() : IsInited (Standard_False)
{
//
}
//! Creates new bounding prism for the given triangle.
BRepExtrema_BoundingPrism (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Real theDeflect)
{
Init (theVertex0,
theVertex1,
theVertex2,
theDeflect);
}
//! Calculates bounding prism for the given triangle.
void Init (const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
const Standard_Real theDeflect)
{
Edges[0] = theVertex1 - theVertex0;
Edges[1] = theVertex2 - theVertex0;
Edges[2] = theVertex2 - theVertex1;
Normal = BVH_Vec3d::Cross (Edges[0], Edges[1]);
EdgeNormals[0] = BVH_Vec3d::Cross (Edges[0], Normal);
EdgeNormals[1] = BVH_Vec3d::Cross (Edges[1], Normal);
EdgeNormals[2] = BVH_Vec3d::Cross (Edges[2], Normal);
EdgeNormals[0] *= 1.0 / Max (EdgeNormals[0].Modulus(), Precision::Confusion());
EdgeNormals[1] *= 1.0 / Max (EdgeNormals[1].Modulus(), Precision::Confusion());
EdgeNormals[2] *= 1.0 / Max (EdgeNormals[2].Modulus(), Precision::Confusion());
const BVH_Vec3d aDirect01 = EdgeNormals[0] - EdgeNormals[1];
const BVH_Vec3d aDirect02 = EdgeNormals[0] + EdgeNormals[2];
const BVH_Vec3d aDirect12 = EdgeNormals[2] - EdgeNormals[1];
Vertices[0] = Vertices[3] = theVertex0 + aDirect01 * (theDeflect / aDirect01.Dot (EdgeNormals[0]));
Vertices[1] = Vertices[4] = theVertex1 + aDirect02 * (theDeflect / aDirect02.Dot (EdgeNormals[2]));
Vertices[2] = Vertices[5] = theVertex2 + aDirect12 * (theDeflect / aDirect12.Dot (EdgeNormals[2]));
const BVH_Vec3d aNormOffset = Normal * (theDeflect / Max (Normal.Modulus(), Precision::Confusion()));
for (Standard_Integer aVertIdx = 0; aVertIdx < 3; ++aVertIdx)
{
Vertices[aVertIdx + 0] += aNormOffset;
Vertices[aVertIdx + 3] -= aNormOffset;
}
IsInited = Standard_True;
}
//! Checks if two prisms are separated along the given axis.
Standard_Boolean Separated (const BRepExtrema_BoundingPrism& thePrism, const BVH_Vec3d& theAxis) const
{
Standard_Real aMin1 = DBL_MAX;
Standard_Real aMax1 = -DBL_MAX;
Standard_Real aMin2 = DBL_MAX;
Standard_Real aMax2 = -DBL_MAX;
for (Standard_Integer aVertIdx = 0; aVertIdx < 6; ++aVertIdx)
{
const Standard_Real aProj1 = Vertices[aVertIdx].Dot (theAxis);
aMin1 = Min (aMin1, aProj1);
aMax1 = Max (aMax1, aProj1);
const Standard_Real aProj2 = thePrism.Vertices[aVertIdx].Dot (theAxis);
aMin2 = Min (aMin2, aProj2);
aMax2 = Max (aMax2, aProj2);
if (aMin1 <= aMax2 && aMax1 >= aMin2)
{
return Standard_False;
}
}
return aMin1 > aMax2 || aMax1 < aMin2;
}
};
// =======================================================================
// function : Separated
// purpose : Checks if triangles can be separated along the given axis
// (projects vertices on this axis and performs interval test)
// =======================================================================
inline Standard_Boolean SeparateTriangles (const BVH_Vec3d& theTrg1Vert0,
const BVH_Vec3d& theTrg1Vert1,
const BVH_Vec3d& theTrg1Vert2,
const BVH_Vec3d& theTrg2Vert0,
const BVH_Vec3d& theTrg2Vert1,
const BVH_Vec3d& theTrg2Vert2,
const BVH_Vec3d& theSplitAxis)
{
const Standard_Real aA1 = theTrg1Vert0.Dot (theSplitAxis);
const Standard_Real aB1 = theTrg1Vert1.Dot (theSplitAxis);
const Standard_Real aC1 = theTrg1Vert2.Dot (theSplitAxis);
const Standard_Real aA2 = theTrg2Vert0.Dot (theSplitAxis);
const Standard_Real aB2 = theTrg2Vert1.Dot (theSplitAxis);
const Standard_Real aC2 = theTrg2Vert2.Dot (theSplitAxis);
const Standard_Real aMin1 = Min (aA1, Min (aB1, aC1));
const Standard_Real aMax1 = Max (aA1, Max (aB1, aC1));
if (aMax1 < Min (aA2, Min (aB2, aC2)))
{
return Standard_True;
}
return aMin1 > Max (aA2, Max (aB2, aC2));
}
// =======================================================================
// function : TrianglesIntersected
// purpose : Checks if two triangles are intersected
// (test uses SAT - Separating Axis Theorem)
// =======================================================================
Standard_Boolean TrianglesIntersected (const BVH_Vec3d& theTrg1Vert0,
const BVH_Vec3d& theTrg1Vert1,
const BVH_Vec3d& theTrg1Vert2,
const BVH_Vec3d& theTrg2Vert0,
const BVH_Vec3d& theTrg2Vert1,
const BVH_Vec3d& theTrg2Vert2)
{
const BVH_Vec3d aEdges1[3] = { theTrg1Vert1 - theTrg1Vert0,
theTrg1Vert2 - theTrg1Vert0,
theTrg1Vert2 - theTrg1Vert1 };
const BVH_Vec3d aTrg1Normal = BVH_Vec3d::Cross (aEdges1[0], aEdges1[1]);
if (SeparateTriangles (theTrg1Vert0,
theTrg1Vert1,
theTrg1Vert2,
theTrg2Vert0,
theTrg2Vert1,
theTrg2Vert2,
aTrg1Normal))
{
return Standard_False;
}
const BVH_Vec3d aEdges2[3] = { theTrg2Vert1 - theTrg2Vert0,
theTrg2Vert2 - theTrg2Vert0,
theTrg2Vert2 - theTrg2Vert1 };
const BVH_Vec3d aTrg2Normal = BVH_Vec3d::Cross (aEdges2[0], aEdges2[1]);
if (SeparateTriangles (theTrg1Vert0,
theTrg1Vert1,
theTrg1Vert2,
theTrg2Vert0,
theTrg2Vert1,
theTrg2Vert2,
aTrg2Normal))
{
return Standard_False;
}
for (Standard_Integer anIdx1 = 0; anIdx1 < 3; ++anIdx1)
{
for (Standard_Integer anIdx2 = 0; anIdx2 < 3; ++anIdx2)
{
const BVH_Vec3d aSplitAxis = BVH_Vec3d::Cross (aEdges1[anIdx1], aEdges2[anIdx2]);
if (SeparateTriangles (theTrg1Vert0,
theTrg1Vert1,
theTrg1Vert2,
theTrg2Vert0,
theTrg2Vert1,
theTrg2Vert2,
aSplitAxis))
{
return Standard_False;
}
}
}
return Standard_True;
}
// =======================================================================
// function : PrismsIntersected
// purpose : Checks if two triangular prisms are intersected
// (test uses SAT - Separating Axis Theorem)
// =======================================================================
Standard_Boolean PrismsIntersected (const BRepExtrema_BoundingPrism& thePrism1,
const BRepExtrema_BoundingPrism& thePrism2)
{
if (thePrism1.Separated (thePrism2, thePrism1.Normal))
{
return Standard_False;
}
if (thePrism1.Separated (thePrism2, thePrism2.Normal))
{
return Standard_False;
}
for (Standard_Integer anIdx = 0; anIdx < 3; ++anIdx)
{
if (thePrism1.Separated (thePrism2, thePrism1.EdgeNormals[anIdx]))
{
return Standard_False;
}
}
for (Standard_Integer anIdx = 0; anIdx < 3; ++anIdx)
{
if (thePrism1.Separated (thePrism2, thePrism2.EdgeNormals[anIdx]))
{
return Standard_False;
}
}
for (Standard_Integer anIdx1 = 0; anIdx1 < 4; ++anIdx1)
{
const BVH_Vec3d& aEdge1 = (anIdx1 == 3) ? thePrism1.Normal : thePrism1.Edges[anIdx1];
for (Standard_Integer anIdx2 = 0; anIdx2 < 4; ++anIdx2)
{
const BVH_Vec3d& aEdge2 = (anIdx2 == 3) ? thePrism2.Normal : thePrism2.Edges[anIdx2];
if (thePrism1.Separated (thePrism2, BVH_Vec3d::Cross (aEdge1, aEdge2)))
{
return Standard_False;
}
}
}
return Standard_True;
}
// =======================================================================
// function : OverlapBoxes
// purpose : Checks if two boxes (AABBs) are overlapped
// =======================================================================
inline Standard_Boolean OverlapBoxes (const BVH_Vec3d& theBoxMin1,
const BVH_Vec3d& theBoxMax1,
const BVH_Vec3d& theBoxMin2,
const BVH_Vec3d& theBoxMax2,
const Standard_Real theTolerance)
{
// Check for overlap
return !(theBoxMin1.x() > theBoxMax2.x() + theTolerance ||
theBoxMax1.x() < theBoxMin2.x() - theTolerance ||
theBoxMin1.y() > theBoxMax2.y() + theTolerance ||
theBoxMax1.y() < theBoxMin2.y() - theTolerance ||
theBoxMin1.z() > theBoxMax2.z() + theTolerance ||
theBoxMax1.z() < theBoxMin2.z() - theTolerance);
}
//=======================================================================
//function : getSetOfFaces
//purpose :
//=======================================================================
TColStd_PackedMapOfInteger& getSetOfFaces (BRepExtrema_OverlappedSubShapes& theShapes,
const Standard_Integer theFaceIdx)
{
if (!theShapes.IsBound (theFaceIdx))
{
theShapes.Bind (theFaceIdx, TColStd_PackedMapOfInteger());
}
return theShapes.ChangeFind (theFaceIdx);
}
}
//=======================================================================
//function : IntersectLeavesExact
//purpose : Narrow-phase of overlap test (exact intersection)
//=======================================================================
void BRepExtrema_ShapeProximity::IntersectLeavesExact (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2)
{
for (Standard_Integer aTrgIdx1 = theLeaf1.y(); aTrgIdx1 <= theLeaf1.z(); ++aTrgIdx1)
{
const Standard_Integer aFaceIdx1 = myPrimitiveSet1->GetFaceID (aTrgIdx1);
BVH_Vec3d aTrg1Vert1;
BVH_Vec3d aTrg1Vert2;
BVH_Vec3d aTrg1Vert3;
myPrimitiveSet1->GetVertices (aTrgIdx1,
aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3);
const Standard_Boolean aIsInSet = myOverlapSubShapes1.IsBound (aFaceIdx1);
for (Standard_Integer aTrgIdx2 = theLeaf2.y(); aTrgIdx2 <= theLeaf2.z(); ++aTrgIdx2)
{
const Standard_Integer aFaceIdx2 = myPrimitiveSet2->GetFaceID (aTrgIdx2);
if (!aIsInSet || !myOverlapSubShapes1.Find (aFaceIdx1).Contains (aFaceIdx2))
{
BVH_Vec3d aTrg2Vert1;
BVH_Vec3d aTrg2Vert2;
BVH_Vec3d aTrg2Vert3;
myPrimitiveSet2->GetVertices (aTrgIdx2, aTrg2Vert1, aTrg2Vert2, aTrg2Vert3);
if (TrianglesIntersected (aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3,
aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3))
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
}
}
}
}
}
//=======================================================================
//function : IntersectLeavesToler
//purpose : Narrow-phase of overlap test (with non-zero tolerance)
//=======================================================================
void BRepExtrema_ShapeProximity::IntersectLeavesToler (const BVH_Vec4i& theLeaf1,
const BVH_Vec4i& theLeaf2)
{
for (Standard_Integer aTrgIdx1 = theLeaf1.y(); aTrgIdx1 <= theLeaf1.z(); ++aTrgIdx1)
{
const Standard_Integer aFaceIdx1 = myPrimitiveSet1->GetFaceID (aTrgIdx1);
BVH_Vec3d aTrg1Vert1;
BVH_Vec3d aTrg1Vert2;
BVH_Vec3d aTrg1Vert3;
myPrimitiveSet1->GetVertices (aTrgIdx1,
aTrg1Vert1,
aTrg1Vert2,
aTrg1Vert3);
BRepExtrema_BoundingPrism aPrism1; // not initialized
const Standard_Boolean aIsInSet = myOverlapSubShapes1.IsBound (aFaceIdx1);
for (Standard_Integer aTrgIdx2 = theLeaf2.y(); aTrgIdx2 <= theLeaf2.z(); ++aTrgIdx2)
{
const Standard_Integer aFaceIdx2 = myPrimitiveSet2->GetFaceID (aTrgIdx2);
if (!aIsInSet || !myOverlapSubShapes1.Find (aFaceIdx1).Contains (aFaceIdx2))
{
if (!aPrism1.IsInited)
{
aPrism1.Init (aTrg1Vert1, aTrg1Vert2, aTrg1Vert3, myTolerance);
}
BVH_Vec3d aTrg2Vert1;
BVH_Vec3d aTrg2Vert2;
BVH_Vec3d aTrg2Vert3;
myPrimitiveSet2->GetVertices (aTrgIdx2,
aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3);
BRepExtrema_BoundingPrism aPrism2 (aTrg2Vert1,
aTrg2Vert2,
aTrg2Vert3,
myTolerance);
if (PrismsIntersected (aPrism1, aPrism2))
{
getSetOfFaces (myOverlapSubShapes1, aFaceIdx1).Add (aFaceIdx2);
getSetOfFaces (myOverlapSubShapes2, aFaceIdx2).Add (aFaceIdx1);
}
}
}
}
return myIsInitS2 = myElementSet2->Init (myFaceList2);
}
//=======================================================================
//function : Perform
//purpose : Performs search for overlapped faces
//purpose : Performs search of overlapped faces
//=======================================================================
void BRepExtrema_ShapeProximity::Perform()
{
if (myIsDone || !myIsInitS1 || !myIsInitS2)
if (!myIsInitS1 || !myIsInitS2 || myOverlapTool.IsDone())
{
return;
}
BRepExtrema_StackItem aStack[96];
myOverlapTool.LoadTriangleSets (myElementSet1,
myElementSet2);
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& aBVH1 = myPrimitiveSet1->BVH();
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& aBVH2 = myPrimitiveSet2->BVH();
if (aBVH1.IsNull() || aBVH2.IsNull())
{
return;
}
BRepExtrema_StackItem aNodes; // current pair of nodes
Standard_Integer aHead = -1; // stack head position
for (;;)
{
BVH_Vec4i aNodeData1 = aBVH1->NodeInfoBuffer()[aNodes.Node1];
BVH_Vec4i aNodeData2 = aBVH2->NodeInfoBuffer()[aNodes.Node2];
if (aNodeData1.x() != 0 && aNodeData2.x() != 0) // leaves
{
if (myTolerance == 0.0)
{
IntersectLeavesExact (aNodeData1, aNodeData2);
}
else
{
IntersectLeavesToler (aNodeData1, aNodeData2);
}
if (aHead < 0)
break;
aNodes = aStack[aHead--];
}
else
{
BRepExtrema_StackItem aPairsToProcess[4];
Standard_Integer aNbPairs = 0;
if (aNodeData1.x() == 0) // inner node
{
const BVH_Vec3d& aMinPntLft1 = aBVH1->MinPoint (aNodeData1.y());
const BVH_Vec3d& aMaxPntLft1 = aBVH1->MaxPoint (aNodeData1.y());
const BVH_Vec3d& aMinPntRgh1 = aBVH1->MinPoint (aNodeData1.z());
const BVH_Vec3d& aMaxPntRgh1 = aBVH1->MaxPoint (aNodeData1.z());
if (aNodeData2.x() == 0) // inner node
{
const BVH_Vec3d& aMinPntLft2 = aBVH2->MinPoint (aNodeData2.y());
const BVH_Vec3d& aMaxPntLft2 = aBVH2->MaxPoint (aNodeData2.y());
const BVH_Vec3d& aMinPntRgh2 = aBVH2->MinPoint (aNodeData2.z());
const BVH_Vec3d& aMaxPntRgh2 = aBVH2->MaxPoint (aNodeData2.z());
if (OverlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntLft2, aMaxPntLft2, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodeData2.y());
}
if (OverlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntRgh2, aMaxPntRgh2, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodeData2.z());
}
if (OverlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntLft2, aMaxPntLft2, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodeData2.y());
}
if (OverlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntRgh2, aMaxPntRgh2, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodeData2.z());
}
}
else
{
const BVH_Vec3d& aMinPntLeaf = aBVH2->MinPoint (aNodes.Node2);
const BVH_Vec3d& aMaxPntLeaf = aBVH2->MaxPoint (aNodes.Node2);
if (OverlapBoxes (aMinPntLft1, aMaxPntLft1, aMinPntLeaf, aMaxPntLeaf, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.y(), aNodes.Node2);
}
if (OverlapBoxes (aMinPntRgh1, aMaxPntRgh1, aMinPntLeaf, aMaxPntLeaf, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodeData1.z(), aNodes.Node2);
}
}
}
else
{
const BVH_Vec3d& aMinPntLeaf = aBVH1->MinPoint (aNodes.Node1);
const BVH_Vec3d& aMaxPntLeaf = aBVH1->MaxPoint (aNodes.Node1);
const BVH_Vec3d& aMinPntLft2 = aBVH2->MinPoint (aNodeData2.y());
const BVH_Vec3d& aMaxPntLft2 = aBVH2->MaxPoint (aNodeData2.y());
const BVH_Vec3d& aMinPntRgh2 = aBVH2->MinPoint (aNodeData2.z());
const BVH_Vec3d& aMaxPntRgh2 = aBVH2->MaxPoint (aNodeData2.z());
if (OverlapBoxes (aMinPntLft2, aMaxPntLft2, aMinPntLeaf, aMaxPntLeaf, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodes.Node1, aNodeData2.y());
}
if (OverlapBoxes (aMinPntRgh2, aMaxPntRgh2, aMinPntLeaf, aMaxPntLeaf, myTolerance))
{
aPairsToProcess[aNbPairs++] = BRepExtrema_StackItem (aNodes.Node1, aNodeData2.z());
}
}
if (aNbPairs > 0)
{
aNodes = aPairsToProcess[0];
for (Standard_Integer anIdx = 1; anIdx < aNbPairs; ++anIdx)
{
aStack[++aHead] = aPairsToProcess[anIdx];
}
}
else
{
if (aHead < 0)
break;
aNodes = aStack[aHead--];
}
}
}
myIsDone = Standard_True;
myOverlapTool.Perform (myTolerance);
}

View File

@@ -17,12 +17,11 @@
#define _BRepExtrema_ShapeProximity_HeaderFile
#include <BVH_Geometry.hxx>
#include <BRepExtrema_TriangleSet.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
#include <NCollection_DataMap.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
//! Set of overlapped sub-shapes.
typedef NCollection_DataMap<Standard_Integer, TColStd_PackedMapOfInteger > BRepExtrema_OverlappedSubShapes;
#include <BRepExtrema_TriangleSet.hxx>
#include <BRepExtrema_OverlapTool.hxx>
//! Tool class for shape proximity detection.
//! For two given shapes and given tolerance (offset from the mesh) the algorithm allows
@@ -38,7 +37,7 @@ typedef NCollection_DataMap<Standard_Integer, TColStd_PackedMapOfInteger > BRepE
//! on distance less than the given tolerance from each other.
class BRepExtrema_ShapeProximity
{
public:
public:
//! Creates empty proximity tool.
Standard_EXPORT BRepExtrema_ShapeProximity (const Standard_Real theTolerance = 0.0);
@@ -68,58 +67,50 @@ public:
//! Loads 2nd shape into proximity tool.
Standard_EXPORT Standard_Boolean LoadShape2 (const TopoDS_Shape& theShape2);
//! Performs search for overlapped faces.
//! Performs search of overlapped faces.
Standard_EXPORT void Perform();
//! True if the search is completed.
Standard_Boolean IsDone() const
{
return myIsDone;
return myOverlapTool.IsDone();
}
//! Returns set of all the face triangles of the 1st shape.
const NCollection_Handle<BRepExtrema_TriangleSet>& PrimitiveSet1() const
//! Returns set of IDs of overlapped faces of 1st shape (started from 0).
const BRepExtrema_MapOfIntegerPackedMapOfInteger& OverlapSubShapes1() const
{
return myPrimitiveSet1;
return myOverlapTool.OverlapSubShapes1();
}
//! Returns set of all the face triangles of the 2nd shape.
const NCollection_Handle<BRepExtrema_TriangleSet>& PrimitiveSet2() const
//! Returns set of IDs of overlapped faces of 2nd shape (started from 0).
const BRepExtrema_MapOfIntegerPackedMapOfInteger& OverlapSubShapes2() const
{
return myPrimitiveSet2;
return myOverlapTool.OverlapSubShapes2();
}
//! Returns set of IDs of overlapped faces of 1st shape.
const BRepExtrema_OverlappedSubShapes& OverlapSubShapes1() const
{
return myOverlapSubShapes1;
}
//! Returns set of IDs of overlapped faces of 2nd shape.
const BRepExtrema_OverlappedSubShapes& OverlapSubShapes2() const
{
return myOverlapSubShapes2;
}
//! Returns sub-shape from 1st shape with the given index.
//! Returns sub-shape from 1st shape with the given index (started from 0).
const TopoDS_Face& GetSubShape1 (const Standard_Integer theID) const
{
return myFaceList1.Value (theID);
}
//! Returns sub-shape from 1st shape with the given index.
//! Returns sub-shape from 1st shape with the given index (started from 0).
const TopoDS_Face& GetSubShape2 (const Standard_Integer theID) const
{
return myFaceList2.Value (theID);
}
protected:
//! Returns set of all the face triangles of the 1st shape.
const Handle(BRepExtrema_TriangleSet)& ElementSet1() const
{
return myElementSet1;
}
//! Performs narrow-phase of overlap test (exact intersection).
void IntersectLeavesExact (const BVH_Vec4i& theLeaf1, const BVH_Vec4i& theLeaf2);
//! Performs narrow-phase of overlap test (intersection with non-zero tolerance).
void IntersectLeavesToler (const BVH_Vec4i& theLeaf1, const BVH_Vec4i& theLeaf2);
//! Returns set of all the face triangles of the 2nd shape.
const Handle(BRepExtrema_TriangleSet)& ElementSet2() const
{
return myElementSet2;
}
private:
@@ -137,17 +128,12 @@ private:
BRepExtrema_ShapeList myFaceList2;
//! Set of all the face triangles of the 1st shape.
NCollection_Handle<BRepExtrema_TriangleSet> myPrimitiveSet1;
Handle(BRepExtrema_TriangleSet) myElementSet1;
//! Set of all the face triangles of the 2nd shape.
NCollection_Handle<BRepExtrema_TriangleSet> myPrimitiveSet2;
Handle(BRepExtrema_TriangleSet) myElementSet2;
//! Set of overlapped faces of 1st shape.
BRepExtrema_OverlappedSubShapes myOverlapSubShapes1;
//! Set of overlapped faces of 2nd shape.
BRepExtrema_OverlappedSubShapes myOverlapSubShapes2;
//! Is overlap test completed?
Standard_Boolean myIsDone;
//! Overlap tool used for intersection/overlap test.
BRepExtrema_OverlapTool myOverlapTool;
};

View File

@@ -21,6 +21,9 @@
#include <Poly_Triangulation.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
IMPLEMENT_STANDARD_HANDLE (BRepExtrema_TriangleSet, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(BRepExtrema_TriangleSet, Standard_Transient)
//=======================================================================
//function : BRepExtrema_TriangleSet
//purpose : Creates empty triangle set
@@ -224,3 +227,4 @@ Standard_Boolean BRepExtrema_TriangleSet::Init (const BRepExtrema_ShapeList& the
return Standard_True;
}

View File

@@ -17,14 +17,13 @@
#define _BRepExtrema_TriangleSet_HeaderFile
#include <TopoDS_Face.hxx>
#include <BVH_PrimitiveSet.hxx>
//! List of shapes and their IDs for collision detection.
typedef NCollection_Vector<TopoDS_Face> BRepExtrema_ShapeList;
//! Triangle set corresponding to specific face.
class BRepExtrema_TriangleSet : public BVH_PrimitiveSet<Standard_Real, 3>
class BRepExtrema_TriangleSet : public BVH_PrimitiveSet<Standard_Real, 3>, public Standard_Transient
{
public:
@@ -79,6 +78,12 @@ protected:
//! Array of vertex coordinates.
BVH_Array3d myVertexArray;
public:
DEFINE_STANDARD_RTTI(BRepExtrema_TriangleSet)
};
DEFINE_STANDARD_HANDLE (BRepExtrema_TriangleSet, Standard_Transient)
#endif // _BRepExtrema_TriangleSet_HeaderFile

View File

@@ -19,5 +19,11 @@ BRepExtrema_SolutionElem.hxx
BRepExtrema_SupportType.hxx
BRepExtrema_TriangleSet.hxx
BRepExtrema_TriangleSet.cxx
BRepExtrema_OverlapTool.hxx
BRepExtrema_OverlapTool.cxx
BRepExtrema_ElementFilter.hxx
BRepExtrema_ShapeProximity.hxx
BRepExtrema_ShapeProximity.cxx
BRepExtrema_SelfIntersection.hxx
BRepExtrema_SelfIntersection.cxx
BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx

View File

@@ -54,6 +54,7 @@
#include <LocOpe_CSIntersector.hxx>
#include <LocOpe_PntFace.hxx>
#include <LocOpe_BuildShape.hxx>
#include <ElSLib.hxx>
#include <TColGeom_SequenceOfCurve.hxx>
@@ -490,14 +491,9 @@ void BRepFeat::FaceUntil(const TopoDS_Shape& Sbase,
{
Bnd_Box B;
BRepBndLib::Add(Sbase,B);
Standard_Real c[6], bnd;
B.Get(c[0],c[2],c[4],c[1],c[3],c[5]);
bnd = c[0];
for(Standard_Integer i = 1 ; i < 6; i++) {
if(c[i] > bnd) bnd = c[i];
}
bnd = 10*bnd;
Standard_Real x[2], y[2], z[2];
B.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
Standard_Real diam = 10.*Sqrt(B.SquareExtent());
Handle(Geom_Surface) s = BRep_Tool::Surface(FUntil);
Handle(Standard_Type) styp = s->DynamicType();
@@ -507,16 +503,80 @@ void BRepFeat::FaceUntil(const TopoDS_Shape& Sbase,
}
Handle(Geom_RectangularTrimmedSurface) str;
if (styp == STANDARD_TYPE(Geom_Plane)) {
gp_Pln aPln = Handle(Geom_Plane)::DownCast(s)->Pln();
Standard_Real u, v, umin = RealLast(), umax = -umin,
vmin = RealLast(), vmax = -vmin;
for(Standard_Integer i = 0 ; i < 2; i++)
{
for(Standard_Integer j = 0; j < 2; j++)
{
for(Standard_Integer k = 0; k < 2; k++)
{
gp_Pnt aP(x[i], y[j], z[k]);
ElSLib::Parameters(aPln, aP, u, v);
if(u < umin)
umin = u;
if(u > umax)
umax = u;
if(v < vmin)
vmin = v;
if(v > vmax)
vmax = v;
}
}
}
umin -= diam;
umax += diam;
vmin -= diam;
vmax += diam;
str = new Geom_RectangularTrimmedSurface
(s, bnd, -bnd, bnd, -bnd, Standard_True, Standard_True);
(s, umin, umax, vmin, vmax, Standard_True, Standard_True);
}
else if (styp == STANDARD_TYPE(Geom_CylindricalSurface)) {
gp_Cylinder aCyl = Handle(Geom_CylindricalSurface)::DownCast(s)->Cylinder();
Standard_Real u, v, vmin = RealLast(), vmax = -vmin;
for(Standard_Integer i = 0 ; i < 2; i++)
{
for(Standard_Integer j = 0; j < 2; j++)
{
for(Standard_Integer k = 0; k < 2; k++)
{
gp_Pnt aP(x[i], y[j], z[k]);
ElSLib::Parameters(aCyl, aP, u, v);
if(v < vmin)
vmin = v;
if(v > vmax)
vmax = v;
}
}
}
vmin -= diam;
vmax += diam;
str = new Geom_RectangularTrimmedSurface
(s, bnd, -bnd, Standard_False, Standard_True);
(s, vmin, vmax, Standard_False, Standard_True);
}
else if (styp == STANDARD_TYPE(Geom_ConicalSurface)) {
gp_Cone aCon = Handle(Geom_ConicalSurface)::DownCast(s)->Cone();
Standard_Real u, v, vmin = RealLast(), vmax = -vmin;
for(Standard_Integer i = 0 ; i < 2; i++)
{
for(Standard_Integer j = 0; j < 2; j++)
{
for(Standard_Integer k = 0; k < 2; k++)
{
gp_Pnt aP(x[i], y[j], z[k]);
ElSLib::Parameters(aCon, aP, u, v);
if(v < vmin)
vmin = v;
if(v > vmax)
vmax = v;
}
}
}
vmin -= diam;
vmax += diam;
str = new Geom_RectangularTrimmedSurface
(s, bnd, -bnd, Standard_False, Standard_True);
(s, vmin, vmax, Standard_False, Standard_True);
}
else {
FUntil.Nullify();

View File

@@ -260,15 +260,15 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
if(myLShape.ShapeType() == TopAbs_WIRE) {
TopExp_Explorer ex1(VraiPrism, TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
for(; ex2.More(); ex2.Next()) {
if(ex2.Current().IsSame(myLShape)) {
FFace = TopoDS::Face(ex1.Current());
found = Standard_True;
break;
}
}
if(found) break;
TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
for(; ex2.More(); ex2.Next()) {
if(ex2.Current().IsSame(myLShape)) {
FFace = TopoDS::Face(ex1.Current());
found = Standard_True;
break;
}
}
if(found) break;
}
}
@@ -276,9 +276,9 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
for(; exp.More(); exp.Next()) {
const TopoDS_Face& ff = TopoDS::Face(exp.Current());
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
break;
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
break;
}
}
}
@@ -570,15 +570,17 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
ASI2.Perform(scur);
TopAbs_Orientation OrU, OrF;
TopoDS_Face FFrom, FUntil;
Standard_Real ParF, ParU;
if (ASI1.IsDone() && ASI1.NbPoints(1) >=1) {
if (myFuse == 1) {
OrU = ASI1.Point(1,1).Orientation();
OrU = ASI1.Point(1,1).Orientation();
}
else {
OrU = ASI1.Point(1,ASI1.NbPoints(1)).Orientation();
OrU = ASI1.Point(1,ASI1.NbPoints(1)).Orientation();
}
if(sens==-1) OrU = TopAbs::Reverse(OrU);
FUntil = ASI1.Point(1,1).Face();
ParU = ASI1.Point(1,1).Parameter();
}
else {
NotDone();
@@ -589,12 +591,20 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
OrF = ASI2.Point(1,1).Orientation();
if(sens==1) OrF = TopAbs::Reverse(OrF);
FFrom = ASI2.Point(1,1).Face();
ParF = ASI2.Point(1,1).Parameter();
}
else {
NotDone();
myStatusError = BRepFeat_NoIntersectF;
return;
}
if(tran > 0 && (Abs(ParU) < Abs(ParF)))
{
TopAbs_Orientation Or;
Or = OrU;
OrU = OrF;
OrF = Or;
}
TopoDS_Shape Comp;
BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Comp));

View File

@@ -78,22 +78,22 @@ extern Standard_Boolean BRepFeat_GettraceFEAT();
#endif
static void MajMap(const TopoDS_Shape&, // base
const LocOpe_Revol&,
TopTools_DataMapOfShapeListOfShape&, // myMap
TopoDS_Shape&, // myFShape
TopoDS_Shape&); // myLShape
const LocOpe_Revol&,
TopTools_DataMapOfShapeListOfShape&, // myMap
TopoDS_Shape&, // myFShape
TopoDS_Shape&); // myLShape
static void VerifGluedFaces(const TopoDS_Face& theSkface,
const TopoDS_Shape& thePbase,
Handle(Geom_Curve)& theBCurve,
TColGeom_SequenceOfCurve& theCurves,
LocOpe_Revol& theRevol,
TopTools_DataMapOfShapeShape& theMap);
const TopoDS_Shape& thePbase,
Handle(Geom_Curve)& theBCurve,
TColGeom_SequenceOfCurve& theCurves,
LocOpe_Revol& theRevol,
TopTools_DataMapOfShapeShape& theMap);
static Standard_Boolean ToFuse(const TopoDS_Face& ,
const TopoDS_Face&);
const TopoDS_Face&);
@@ -104,11 +104,11 @@ static Standard_Boolean ToFuse(const TopoDS_Face& ,
//=======================================================================
void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
const TopoDS_Shape& Pbase,
const TopoDS_Face& Skface,
const gp_Ax1& Axis,
const Standard_Integer Mode,
const Standard_Boolean Modify)
const TopoDS_Shape& Pbase,
const TopoDS_Face& Skface,
const gp_Ax1& Axis,
const Standard_Integer Mode,
const Standard_Boolean Modify)
{
#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
@@ -140,7 +140,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
myJustGluer = Standard_False;
//-------------- ifv
// mySkface.Nullify();
// mySkface.Nullify();
//-------------- ifv
@@ -171,7 +171,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
//=======================================================================
void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
const TopoDS_Face& F)
const TopoDS_Face& F)
{
#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
@@ -237,13 +237,13 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
if(RevolComp) {
/*
if (!mySkface.IsNull() || !mySlface.IsEmpty()) {
for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
if (exp.Current().IsSame(mySkface)) {
angledec = M_PI/5; // pourquoi pas
if (myFuse) angledec = -angledec;
break;
}
}
for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
if (exp.Current().IsSame(mySkface)) {
angledec = M_PI/5; // pourquoi pas
if (myFuse) angledec = -angledec;
break;
}
}
}
*/
mySkface.Nullify();
@@ -252,7 +252,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
else theRevol.Perform(myPbase, myAxis, Angle, angledec);
TopoDS_Shape VraiRevol = theRevol.Shape();
MajMap(myPbase,theRevol,myMap,myFShape,myLShape);
myGShape = VraiRevol;
@@ -268,32 +268,32 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
}
TopoDS_Face FFace;
Standard_Boolean found = Standard_False;
if(!mySkface.IsNull() || !mySlface.IsEmpty()) {
if(myLShape.ShapeType() == TopAbs_WIRE) {
TopExp_Explorer ex1(VraiRevol, TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
for(; ex2.More(); ex2.Next()) {
if(ex2.Current().IsSame(myLShape)) {
FFace = TopoDS::Face(ex1.Current());
found = Standard_True;
break;
}
}
if(found) break;
TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
for(; ex2.More(); ex2.Next()) {
if(ex2.Current().IsSame(myLShape)) {
FFace = TopoDS::Face(ex1.Current());
found = Standard_True;
break;
}
}
if(found) break;
}
}
TopExp_Explorer exp(mySbase, TopAbs_FACE);
for(; exp.More(); exp.Next()) {
const TopoDS_Face& ff = TopoDS::Face(exp.Current());
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
break;
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
break;
}
}
}
@@ -372,8 +372,8 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
Standard_Boolean Trf = TransformShapeFU(1);
ShapeUntilValid();
// Do systematically almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
// Do systematically almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
LocOpe_Revol theRevol;
if(!TourComplet) {
Angle = 2.*M_PI- 3*M_PI/180.;
@@ -387,10 +387,10 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
if(!Trf) {
myGShape = VraiRevol;
GeneratedShapeValid();
TopoDS_Shape Base = theRevol.FirstShape();
exp.Init(Base, TopAbs_FACE);
TopoDS_Face theBase = TopoDS::Face(exp.Current());
@@ -430,79 +430,79 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
TopoDS_Shape Cutsh = trP.Shape();
TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
for(; ex.More(); ex.Next()) {
TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
if(fac.IsSame(myPbase)) {
VraiRevol = ex.Current();
break;
}
}
TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
if(fac.IsSame(myPbase)) {
VraiRevol = ex.Current();
break;
}
}
}
if(myFuse == 1) {
//modified by NIZNHY-PKV Thu Mar 21 18:17:53 2002 f
//BRepAlgo_Fuse f(mySbase, VraiRevol);
//myShape = f.Shape();
//UpdateDescendants(f.Builder(), myShape, Standard_False);
BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
myShape = f.Shape();
UpdateDescendants(f, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:17:57 2002 t
Done();
//modified by NIZNHY-PKV Thu Mar 21 18:17:53 2002 f
//BRepAlgo_Fuse f(mySbase, VraiRevol);
//myShape = f.Shape();
//UpdateDescendants(f.Builder(), myShape, Standard_False);
BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
myShape = f.Shape();
UpdateDescendants(f, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:17:57 2002 t
Done();
}
else if(myFuse == 0) {
//modified by NIZNHY-PKV Thu Mar 21 18:18:23 2002 f
//BRepAlgo_Cut c(mySbase, VraiRevol);
//myShape = c.Shape();
//UpdateDescendants(c.Builder(), myShape, Standard_False);
BRepAlgoAPI_Cut c(mySbase, VraiRevol);
myShape = c.Shape();
UpdateDescendants(c, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:18:28 2002 t
Done();
//modified by NIZNHY-PKV Thu Mar 21 18:18:23 2002 f
//BRepAlgo_Cut c(mySbase, VraiRevol);
//myShape = c.Shape();
//UpdateDescendants(c.Builder(), myShape, Standard_False);
BRepAlgoAPI_Cut c(mySbase, VraiRevol);
myShape = c.Shape();
UpdateDescendants(c, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:18:28 2002 t
Done();
}
else {
myShape = VraiRevol;
Done();
myShape = VraiRevol;
Done();
}
}
}
// Loop of control of descendance
/*
// Loop of control of descendance
/*
TopExp_Explorer expr(mySbase, TopAbs_FACE);
char nom1[20], nom2[20];
Standard_Integer ii = 0;
for(; expr.More(); expr.Next()) {
ii++;
sprintf(nom1, "faceinitial_%d", ii);
DBRep::Set(nom1, expr.Current());
Standard_Integer jj = 0;
const TopTools_ListOfShape& list = Modified(expr.Current());
TopTools_ListIteratorOfListOfShape ite(list);
for(; ite.More(); ite.Next()) {
jj++;
sprintf(nom2, "facemodifie_%d_%d", ii, jj);
DBRep::Set(nom2, ite.Value());
}
ii++;
sprintf(nom1, "faceinitial_%d", ii);
DBRep::Set(nom1, expr.Current());
Standard_Integer jj = 0;
const TopTools_ListOfShape& list = Modified(expr.Current());
TopTools_ListIteratorOfListOfShape ite(list);
for(; ite.More(); ite.Next()) {
jj++;
sprintf(nom2, "facemodifie_%d_%d", ii, jj);
DBRep::Set(nom2, ite.Value());
}
}
expr.Init(myPbase, TopAbs_EDGE);
ii=0;
for(; expr.More(); expr.Next()) {
ii++;
sprintf(nom1, "edgeinitial_%d", ii);
DBRep::Set(nom1, expr.Current());
Standard_Integer jj = 0;
const TopTools_ListOfShape& list = Generated(expr.Current());
TopTools_ListIteratorOfListOfShape ite(list);
for(; ite.More(); ite.Next()) {
jj++;
sprintf(nom2, "facegeneree_%d_%d", ii, jj);
DBRep::Set(nom2, ite.Value());
}
ii++;
sprintf(nom1, "edgeinitial_%d", ii);
DBRep::Set(nom1, expr.Current());
Standard_Integer jj = 0;
const TopTools_ListOfShape& list = Generated(expr.Current());
TopTools_ListIteratorOfListOfShape ite(list);
for(; ite.More(); ite.Next()) {
jj++;
sprintf(nom2, "facegeneree_%d_%d", ii, jj);
DBRep::Set(nom2, ite.Value());
}
*/
}
}
*/
}
//=======================================================================
@@ -511,7 +511,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
//=======================================================================
void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
const TopoDS_Shape& Until)
const TopoDS_Shape& Until)
{
#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
@@ -553,7 +553,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
mySUntil = Until;
Standard_Boolean Trfu = TransformShapeFU(1);
ShapeUntilValid();
if(Trfu != Trff) {
NotDone();
myStatusError = BRepFeat_IncTypes;
@@ -570,7 +570,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
myGShape = VraiRevol;
GeneratedShapeValid();
GluedFacesValid();
// VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theRevol, myGluedF);
// VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theRevol, myGluedF);
theRevol.Curves(myCurves);
myBCurve = theRevol.BarycCurve();
@@ -604,7 +604,8 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
pr1 = ElCLib::InPeriod(pr1,PrU-2*M_PI,PrU);
Standard_Real pr2 = ASI2.Point(1,ASI2.NbPoints(1)).Parameter();
pr2 = ElCLib::InPeriod(pr2,PrU-2*M_PI,PrU);
OrF = OrU;
//OrF = OrU;
OrF = TopAbs::Reverse(OrU);
FFrom = ASI2.Point(1,1).Face();
PrF = Max(pr1, pr2);
}
@@ -631,18 +632,18 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
//modified by NIZNHY-PKV Thu Mar 21 18:18:57 2002 t
TopoDS_Shape Cutsh = trP.Shape();
TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
// Standard_Real PrF = BRepFeat::ParametricBarycenter(mySFrom, myBCurve);
// Standard_Real PrU = BRepFeat::ParametricBarycenter(mySUntil, myBCurve);
// Standard_Real PrF = BRepFeat::ParametricBarycenter(mySFrom, myBCurve);
// Standard_Real PrU = BRepFeat::ParametricBarycenter(mySUntil, myBCurve);
VraiRevol = ex.Current();
for(; ex.More(); ex.Next()) {
Standard_Real PrCur = BRepFeat::
ParametricBarycenter(ex.Current(), myBCurve);
ParametricBarycenter(ex.Current(), myBCurve);
if(PrF <= PrCur && PrU >= PrCur) {
VraiRevol = ex.Current();
break;
VraiRevol = ex.Current();
break;
}
}
if(myFuse == 1) {
if(myFuse == 1 && !myJustFeat) {
//modified by NIZNHY-PKV Thu Mar 21 18:19:14 2002 f
//BRepAlgo_Fuse f(mySbase, VraiRevol);
//myShape = f.Shape();
@@ -653,7 +654,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
//modified by NIZNHY-PKV Thu Mar 21 18:19:18 2002 t
Done();
}
else if(myFuse == 0) {
else if(myFuse == 0 && !myJustFeat) {
//modified by NIZNHY-PKV Thu Mar 21 18:19:46 2002 f
//BRepAlgo_Cut c(mySbase, VraiRevol);
//myShape = c.Shape();
@@ -692,7 +693,7 @@ void BRepFeat_MakeRevol::PerformThruAll()
//=======================================================================
void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
const Standard_Real Angle)
const Standard_Real Angle)
{
#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
@@ -721,8 +722,8 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
Standard_Boolean Trf = TransformShapeFU(1);
ShapeUntilValid();
// Produce systematicallt an almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
// Produce systematicallt an almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
LocOpe_Revol theRevol;
theRevol.Perform(myPbase, myAxis, Angle);
TopoDS_Shape VraiRevol = theRevol.Shape();
@@ -732,7 +733,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
if(Trf) {
myGShape = VraiRevol;
GeneratedShapeValid();
TopoDS_Shape Base = theRevol.FirstShape();
exp.Init(Base, TopAbs_FACE);
TopoDS_Face theBase = TopoDS::Face(exp.Current());
@@ -773,40 +774,40 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
TopoDS_Shape Cutsh = trP.Shape();
TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
for(; ex.More(); ex.Next()) {
TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
if(fac.IsSame(myPbase)) {
VraiRevol = ex.Current();
break;
}
}
TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
if(fac.IsSame(myPbase)) {
VraiRevol = ex.Current();
break;
}
}
}
if(myFuse == 1) {
//modified by NIZNHY-PKV Thu Mar 21 18:20:36 2002 f
//BRepAlgo_Fuse f(mySbase, VraiRevol);
//myShape = f.Shape();
//UpdateDescendants(f.Builder(), myShape, Standard_False);
BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
myShape = f.Shape();
UpdateDescendants(f, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:20:40 2002 t
Done();
//modified by NIZNHY-PKV Thu Mar 21 18:20:36 2002 f
//BRepAlgo_Fuse f(mySbase, VraiRevol);
//myShape = f.Shape();
//UpdateDescendants(f.Builder(), myShape, Standard_False);
BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
myShape = f.Shape();
UpdateDescendants(f, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:20:40 2002 t
Done();
}
else if(myFuse == 0) {
//modified by NIZNHY-PKV Thu Mar 21 18:21:07 2002 f
//BRepAlgo_Cut c(mySbase, VraiRevol);
//myShape = c.Shape();
//UpdateDescendants(c.Builder(), myShape, Standard_False);
BRepAlgoAPI_Cut c(mySbase, VraiRevol);
myShape = c.Shape();
UpdateDescendants(c, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:21:26 2002 t
Done();
//modified by NIZNHY-PKV Thu Mar 21 18:21:07 2002 f
//BRepAlgo_Cut c(mySbase, VraiRevol);
//myShape = c.Shape();
//UpdateDescendants(c.Builder(), myShape, Standard_False);
BRepAlgoAPI_Cut c(mySbase, VraiRevol);
myShape = c.Shape();
UpdateDescendants(c, myShape, Standard_False);
//modified by NIZNHY-PKV Thu Mar 21 18:21:26 2002 t
Done();
}
else {
myShape = VraiRevol;
Done();
myShape = VraiRevol;
Done();
}
}
}
@@ -838,15 +839,15 @@ Handle(Geom_Curve) BRepFeat_MakeRevol::BarycCurve()
//=======================================================================
static void VerifGluedFaces(const TopoDS_Face& theSkface,
const TopoDS_Shape& thePbase,
Handle(Geom_Curve)& theBCurve,
TColGeom_SequenceOfCurve& theCurves,
LocOpe_Revol& theRevol,
TopTools_DataMapOfShapeShape& theMap)
const TopoDS_Shape& thePbase,
Handle(Geom_Curve)& theBCurve,
TColGeom_SequenceOfCurve& theCurves,
LocOpe_Revol& theRevol,
TopTools_DataMapOfShapeShape& theMap)
{
Standard_Boolean GluedFaces = Standard_True;
TopoDS_Shape VraiRevol = theRevol.Shape();
TColGeom_SequenceOfCurve scur;
theRevol.Curves(theCurves);
theBCurve = theRevol.BarycCurve();
@@ -871,13 +872,13 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
for(; ex.More(); ex.Next()) {
TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
const TopoDS_Face& fac1 = TopoDS::Face(ex1.Current());
TopExp_Explorer ex2(thePbase, TopAbs_FACE);
for(; ex2.More(); ex2.Next()) {
const TopoDS_Face& fac2 = TopoDS::Face(ex2.Current());
if(fac1.IsSame(fac2)) break;
}
if (ex2.More()) break;
const TopoDS_Face& fac1 = TopoDS::Face(ex1.Current());
TopExp_Explorer ex2(thePbase, TopAbs_FACE);
for(; ex2.More(); ex2.Next()) {
const TopoDS_Face& fac2 = TopoDS::Face(ex2.Current());
if(fac1.IsSame(fac2)) break;
}
if (ex2.More()) break;
}
if (ex1.More()) continue;
GluedFaces = Standard_False;
@@ -899,10 +900,10 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
//=======================================================================
static void MajMap(const TopoDS_Shape& theB,
const LocOpe_Revol& theP,
TopTools_DataMapOfShapeListOfShape& theMap, // myMap
TopoDS_Shape& theFShape, // myFShape
TopoDS_Shape& theLShape) // myLShape
const LocOpe_Revol& theP,
TopTools_DataMapOfShapeListOfShape& theMap, // myMap
TopoDS_Shape& theFShape, // myFShape
TopoDS_Shape& theLShape) // myLShape
{
TopExp_Explorer exp(theP.FirstShape(),TopAbs_WIRE);
if (exp.More()) {
@@ -913,7 +914,7 @@ static void MajMap(const TopoDS_Shape& theB,
theMap(theFShape).Append(exp.Current());
}
}
exp.Init(theP.LastShape(),TopAbs_WIRE);
if (exp.More()) {
theLShape = exp.Current();
@@ -941,7 +942,7 @@ static void MajMap(const TopoDS_Shape& theB,
//=======================================================================
Standard_Boolean ToFuse(const TopoDS_Face& F1,
const TopoDS_Face& F2)
const TopoDS_Face& F2)
{
if (F1.IsNull() || F2.IsNull()) {
return Standard_False;

View File

@@ -60,6 +60,7 @@
#include <TColgp_HArray1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_SequenceOfReal.hxx>
@@ -1248,10 +1249,12 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
if (report || nbmin<nbmax) {
// insertion of cuts
Standard_Integer nbdec=(nbmax-1)*nbSects+1;
Standard_Real tol = 0.01;
TColStd_Array1OfReal dec(1,nbdec);
dec.Init(0);
dec(2)=1;
TColStd_Array1OfReal WireLen(1, nbSects);
// calculate the table of cuts
Standard_Integer j,k,l;
for (i=1; i<=nbSects; i++) {
@@ -1265,6 +1268,7 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
TColStd_Array1OfReal ACR(0,nbE);
ACR.Init(0);
BRepFill::ComputeACR(wire1, ACR);
WireLen(i) = ACR(0);
// insertion of ACR of the wire in the table of cuts
for (j=1; j<ACR.Length()-1; j++) {
k=1;
@@ -1272,7 +1276,7 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
k++;
if (k>nbdec) break;
}
if (dec(k-1)+tol<ACR(j)&& ACR(j)+tol<dec(k)) {
if (dec(k-1)<ACR(j)&& ACR(j)<dec(k)) {
for (l=nbdec-1;l>=k;l--) {
dec(l+1)=dec(l);
}
@@ -1293,10 +1297,38 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
dec2(k) = dec(k);
}
//Check of cuts: are all the new edges long enouph or not
TColStd_MapOfInteger CutsToRemove;
for (k = 1; k <= nbdec; k++)
{
Standard_Real Knot1 = dec2(k);
Standard_Real Knot2 = (k == nbdec)? 1. : dec2(k+1);
Standard_Real AllLengthsNull = Standard_True;
for (i = 1; i <= nbSects; i++)
{
Standard_Real EdgeLen = (Knot2 - Knot1) * WireLen(i);
if (EdgeLen > Precision::Confusion())
{
AllLengthsNull = Standard_False;
break;
}
}
if (AllLengthsNull)
CutsToRemove.Add(k);
}
Standard_Integer NewNbDec = nbdec - CutsToRemove.Extent();
TColStd_Array1OfReal dec3(1, NewNbDec);
i = 1;
for (k = 1; k <= nbdec; k++)
if (!CutsToRemove.Contains(k))
dec3(i++) = dec2(k);
///////////////////
// insertion of cuts in each wire
for (i=1; i<=nbSects; i++) {
const TopoDS_Wire& oldwire = TopoDS::Wire(myWork(i));
TopoDS_Wire newwire = BRepFill::InsertACR(oldwire, dec2, tol);
Standard_Real tol = Precision::Confusion() / WireLen(i);
TopoDS_Wire newwire = BRepFill::InsertACR(oldwire, dec3, tol);
BRepTools_WireExplorer anExp1,anExp2;
anExp1.Init(oldwire);
anExp2.Init(newwire);

View File

@@ -808,6 +808,24 @@ void BRepFill_OffsetWire::PerformWithBiLo
}
}
//Remove possible hanging arcs on vertices
if (myIsOpenResult && myJoinType == GeomAbs_Arc)
{
if (!myMap.IsEmpty() &&
myMap.FindKey(1).ShapeType() == TopAbs_VERTEX)
{
//myMap.RemoveFirst();
TopoDS_Shape LastShape = myMap.FindKey(myMap.Extent());
TopTools_ListOfShape LastList;
LastList.Append(myMap(myMap.Extent()));
myMap.RemoveLast();
if (!myMap.IsEmpty())
myMap.Substitute(1, LastShape, LastList);
}
if (!myMap.IsEmpty() &&
myMap.FindKey(myMap.Extent()).ShapeType() == TopAbs_VERTEX)
myMap.RemoveLast();
}
#ifdef OCCT_DEBUG
#ifdef DRAW
@@ -900,6 +918,9 @@ void BRepFill_OffsetWire::PerformWithBiLo
// MapNodeVertex,VE);
}
if (myJoinType == GeomAbs_Intersection)
StartOnEdge = EndOnEdge = 0;
//---------------------------------------------
// Construction of geometries.
//---------------------------------------------
@@ -912,7 +933,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
// Construction of vertices on edges parallel to the spine.
//-----------------------------------------------------------
Trim.IntersectWith(E [0], E [1], Params);
Trim.IntersectWith(E [0], E [1], myJoinType, Params);
for (Standard_Integer s = 1; s <= Params.Length(); s++) {
TopoDS_Vertex VC;
@@ -1131,7 +1152,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
TV2->UpdateTolerance( 1.5*dist2 );
}
FixHoles();
if (!myIsOpenResult)
FixHoles();
myIsDone = Standard_True;
}
@@ -1396,7 +1418,19 @@ void BRepFill_OffsetWire::MakeWires()
CV = VF = TopoDS::Vertex(MVE.FindKey(i));
CE = TopoDS::Edge(MVE(i).First());
End = Standard_False;
MVE.ChangeFromKey(CV).RemoveFirst();
MVE.ChangeFromKey(CV).RemoveFirst();
if (myIsOpenResult && MVE.FindFromKey(CV).IsEmpty())
{
//MVE.UnBind(CV);
TopoDS_Shape LastShape = MVE.FindKey(MVE.Extent());
TopTools_ListOfShape LastList;
LastList.Append(MVE(MVE.Extent()));
MVE.RemoveLast();
if (MVE.FindIndex(CV) != 0)
MVE.Substitute(MVE.FindIndex(CV), LastShape, LastList);
}
// Modified by Sergey KHROMOV - Thu Mar 14 11:29:59 2002 Begin
Standard_Boolean isClosed = Standard_False;
@@ -1440,6 +1474,9 @@ void BRepFill_OffsetWire::MakeWires()
CE = TopoDS::Edge(MVE.FindFromKey(CV).First());
MVE.ChangeFromKey(CV).RemoveFirst();
}
else if (myIsOpenResult)//CV was a vertex with one edge
End = Standard_True;
if (MVE.FindFromKey(CV).IsEmpty())
{
//MVE.UnBind(CV);
@@ -1550,7 +1587,7 @@ void BRepFill_OffsetWire::FixHoles()
Pf = BRep_Tool::Pnt(Vf);
Pl = BRep_Tool::Pnt(Vl);
Standard_Real DistF = RealLast(), DistL = RealLast();
Standard_Integer IndexF = 1, IndexL = 1;
Standard_Integer IndexF = 0, IndexL = 0;
Standard_Boolean IsFirstF = Standard_False, IsFirstL = Standard_False;
for (Standard_Integer i = 2; i <= UnclosedWires.Length(); i++)
{
@@ -1601,6 +1638,10 @@ void BRepFill_OffsetWire::FixHoles()
IsFirstL = Standard_False;
}
}
if (DistF > MaxTol)
IndexF = 0;
if (DistL > MaxTol)
IndexL = 0;
TopoDS_Wire theWire;
TopoDS_Edge theEdge;
TopoDS_Vertex theVertex;
@@ -2232,10 +2273,10 @@ void TrimEdge (const TopoDS_Edge& E,
// otherwise preserve only one of its representations.
//----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) {
Standard_Real aParTol = 2.0 * Precision::PConfusion();
for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
if (TheVer.Value(k).IsSame(TheVer.Value(k+1)) ||
Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= Precision::PConfusion()) {
Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= aParTol) {
if(k+1 == TheVer.Length()) {
StoreInMap(TheVer(k), TheVer(k+1), MapVV);

View File

@@ -798,14 +798,14 @@ Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S,
case TopAbs_WIRE :
{
Standard_Integer ii = InitialLength+1;
Handle(BRepFill_ShapeLaw) Section =
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
InitialLength += Section->NbLaw();
for (; (ii<=InitialLength) && (!result); ii++) {
if (E.IsSame(Section->Edge(ii)) ) result = ii;
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
Standard_Integer NbLaw = Section->NbLaw();
for (Standard_Integer ii = 1; (ii<=NbLaw) && (!result); ii++) {
if (E.IsSame(Section->Edge(ii)) ) result = InitialLength + ii;
}
InitialLength += NbLaw;
break;
}

View File

@@ -26,7 +26,8 @@ uses
Curve from Geom2d,
Geometry from Geom2d,
SequenceOfPnt from TColgp,
Curve from Geom2dAdaptor
Curve from Geom2dAdaptor,
JoinType from GeomAbs
is
Create
@@ -39,6 +40,7 @@ is
IntersectWith( me : in out;
Edge1 , Edge2 : Edge from TopoDS;
theJoinType : JoinType from GeomAbs;
Params : in out SequenceOfPnt from TColgp)
is static;

View File

@@ -303,8 +303,9 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
//=======================================================================
void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2,
TColgp_SequenceOfPnt& Params)
const TopoDS_Edge& Edge2,
const GeomAbs_JoinType theJoinType,
TColgp_SequenceOfPnt& Params)
{
Params.Clear();
@@ -553,6 +554,23 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Points2.Remove(Params.Length()+1, Points2.Length());
}
NbPoints = Params.Length();
if (NbPoints > 0 && theJoinType == GeomAbs_Intersection)
{
//Remove all vertices with non-minimal parameter
Standard_Integer imin = 1;
for (i = 2; i <= NbPoints; i++)
if (Params(i).X() < Params(imin).X())
imin = i;
gp_Pnt Pnt1 = Params(imin);
gp_Pnt Pnt2 = Points2(imin);
Params.Clear();
Points2.Clear();
Params.Append(Pnt1);
Points2.Append(Pnt2);
}
NbPoints = Params.Length();
for ( i = 1; i <= NbPoints; i++) {
PSeq = Params(i);

View File

@@ -105,21 +105,27 @@ is
-- computations
--
Perform(me:out);
Perform(me:out;
isTheMultyTheradDisabled : Boolean from Standard = Standard_False);
---Purpose:
-- Performs the calculation
-- If isTheMultyTheadDisabled == TRUE then computation will be made
-- without any parallelization.
CheckData(me:out)
is protected;
---Purpose:
-- Checks the data
Compute(me:out;
thePCurve : Curve from Geom2d)
thePCurve : Curve from Geom2d;
isTheMultyTheradDisabled : Boolean from Standard)
is protected;
---Purpose:
-- Computes the max distance for the 3d curve <myCurve>
-- and 2d curve <thePCurve>
-- If isTheMultyTheadDisabled == TRUE then computation will be made
-- without any parallelization.
-- results
--
@@ -156,6 +162,7 @@ fields
-- source data
myCurve : Curve from Geom;
myPCurve : Curve from Geom2d;
-- 2nd p-curve (for closed surface)
myPCurve2 : Curve from Geom2d;
mySurface : Surface from Geom;
myFirst : Real from Standard;

View File

@@ -14,73 +14,107 @@
#include <BRepLib_CheckCurveOnSurface.ixx>
#include <math_GlobOptMin.hxx>
#include <math_MultipleVarFunctionWithHessian.hxx>
#include <math_Matrix.hxx>
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <BRep_Tool.hxx>
#include <Geom2dAdaptor.hxx>
#include <Geom2dAdaptor_GHCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomProjLib.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom2dAdaptor.hxx>
#include <NCollection_Array1.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomProjLib.hxx>
#include <BRep_Tool.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_CurveRepresentation.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <TopLoc_Location.hxx>
#include <OSD_Parallel.hxx>
#include <ProjLib_ProjectedCurve.hxx>
#include <Standard_ErrorHandler.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TopoDS.hxx>
#include <math_Matrix.hxx>
#include <math_MultipleVarFunctionWithHessian.hxx>
#include <math_NewtonMinimum.hxx>
#include <math_PSO.hxx>
#include <math_PSOParticlesPool.hxx>
class BRepLib_CheckCurveOnSurface_TargetFunc;
static
Standard_Boolean MinComputing(
BRepLib_CheckCurveOnSurface_TargetFunc& theFunction,
const Standard_Real theEpsilon, //1.0e-3
const Standard_Integer theNbParticles,
Standard_Real& theBestValue,
Standard_Real& theBestParameter);
static Standard_Integer FillSubIntervals( const Handle(Geom_Curve)& theCurve3d,
const Handle(Geom2d_Curve)& theCurve2d,
const Standard_Real theFirst,
const Standard_Real theLast,
Standard_Integer &theNbParticles,
TColStd_Array1OfReal* const theSubIntervals = 0);
//=======================================================================
//class : BRepLib_CheckCurveOnSurface_GlobOptFunc
//purpose : provides necessary methods to be used in math_GlobOptMin
//class : BRepLib_CheckCurveOnSurface_TargetFunc
//purpose : Target function (to be minimized)
//=======================================================================
class BRepLib_CheckCurveOnSurface_GlobOptFunc :
class BRepLib_CheckCurveOnSurface_TargetFunc :
public math_MultipleVarFunctionWithHessian
{
public:
BRepLib_CheckCurveOnSurface_GlobOptFunc
(BRepLib_CheckCurveOnSurface_GlobOptFunc&);
BRepLib_CheckCurveOnSurface_GlobOptFunc
(const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
const Handle(Geom_Surface)& theSurf,
const Standard_Real theFirst,
const Standard_Real theLast)
:
myCurve(theC3D),
myPCurve(theC2D),
mySurf(theSurf),
myFirst(theFirst),
myLast(theLast)
BRepLib_CheckCurveOnSurface_TargetFunc( const Adaptor3d_Curve& theC3D,
const Adaptor3d_Curve& theAdCS,
const Standard_Real theFirst,
const Standard_Real theLast):
myCurve1(theC3D),
myCurve2(theAdCS),
myFirst(theFirst),
myLast(theLast)
{
}
//
//returns the number of parameters of the function
//(the function is one-dimension).
virtual Standard_Integer NbVariables() const {
return 1;
}
//
//returns value of the function when parameters are equal to theX
virtual Standard_Boolean Value(const math_Vector& theX,
Standard_Real& theFVal) {
try {
const Standard_Real aPar = theX(1);
if (!CheckParameter(aPar))
Standard_Real& theFVal)
{
return Value(theX(1), theFVal);
}
//returns value of the one-dimension-function when parameter
//is equal to theX
Standard_Boolean Value( const Standard_Real theX,
Standard_Real& theFVal) const
{
try
{
OCC_CATCH_SIGNALS
if (!CheckParameter(theX))
return Standard_False;
gp_Pnt aP1, aP2;
gp_Pnt2d aP2d;
//
myCurve->D0(aPar, aP1);
myPCurve->D0(aPar, aP2d);
mySurf->D0(aP2d.X(), aP2d.Y(), aP2);
//
const gp_Pnt aP1(myCurve1.Value(theX)),
aP2(myCurve2.Value(theX));
theFVal = -1.0*aP1.SquareDistance(aP2);
}
catch(Standard_Failure) {
@@ -89,44 +123,58 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
//
return Standard_True;
}
//
virtual Standard_Integer GetStateNumber() {
//see analogical method for abstract owner class math_MultipleVarFunction
virtual Standard_Integer GetStateNumber()
{
return 0;
}
//
//returns the gradient of the function when parameters are
//equal to theX
virtual Standard_Boolean Gradient(const math_Vector& theX,
math_Vector& theGrad) {
try {
const Standard_Real aPar = theX(1);
if (!CheckParameter(aPar)) {
math_Vector& theGrad)
{
return Derive(theX(1), theGrad(1));
}
//returns 1st derivative of the the one-dimension-function when
//parameter is equal to theX
Standard_Boolean Derive(const Standard_Real theX, Standard_Real& theDeriv) const
{
try
{
OCC_CATCH_SIGNALS
if (!CheckParameter(theX))
{
return Standard_False;
}
//
gp_Pnt aP1, aP2;
gp_Vec aDC3D, aDSU, aDSV;
gp_Pnt2d aP2d;
gp_Vec2d aDC2D;
gp_Vec aDC1, aDC2;
//
myCurve->D1(aPar, aP1, aDC3D);
myPCurve->D1(aPar, aP2d, aDC2D);
mySurf->D1(aP2d.X(), aP2d.Y(), aP2, aDSU, aDSV);
myCurve1.D1(theX, aP1, aDC1);
myCurve2.D1(theX, aP2, aDC2);
const gp_Vec aVec1(aP1, aP2), aVec2(aDC2-aDC1);
//
aP1.SetXYZ(aP1.XYZ() - aP2.XYZ());
aP2.SetXYZ(aDC3D.XYZ() - aDC2D.X()*aDSU.XYZ() - aDC2D.Y()*aDSV.XYZ());
//
theGrad(1) = -2.0*aP1.XYZ().Dot(aP2.XYZ());
theDeriv = -2.0*aVec1.Dot(aVec2);
}
catch(Standard_Failure) {
catch(Standard_Failure)
{
return Standard_False;
}
//
return Standard_True;
}
//
//returns value and gradient
virtual Standard_Boolean Values(const math_Vector& theX,
Standard_Real& theVal,
math_Vector& theGrad) {
if (!Value(theX, theVal)) {
math_Vector& theGrad)
{
if (!Value(theX, theVal))
{
return Standard_False;
}
//
@@ -136,16 +184,20 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
//
return Standard_True;
}
//
//returns value, gradient and hessian
virtual Standard_Boolean Values(const math_Vector& theX,
Standard_Real& theVal,
math_Vector& theGrad,
math_Matrix& theHessian) {
if (!Value(theX, theVal)) {
math_Matrix& theHessian)
{
if (!Value(theX, theVal))
{
return Standard_False;
}
//
if (!Gradient(theX, theGrad)) {
//
if (!Gradient(theX, theGrad))
{
return Standard_False;
}
//
@@ -154,27 +206,117 @@ class BRepLib_CheckCurveOnSurface_GlobOptFunc :
return Standard_True;
}
//
private:
Standard_Boolean CheckParameter(const Standard_Real theParam) {
return ((myFirst <= theParam) && (theParam <= myLast));
Standard_Real FirstParameter() const
{
return myFirst;
}
Handle(Geom_Curve) myCurve;
Handle(Geom2d_Curve) myPCurve;
Handle(Geom_Surface) mySurf;
Standard_Real myFirst;
Standard_Real myLast;
//
Standard_Real LastParameter() const
{
return myLast;
}
private:
BRepLib_CheckCurveOnSurface_TargetFunc operator=(BRepLib_CheckCurveOnSurface_TargetFunc&);
//checks if the function can be computed when its parameter is
//equal to theParam
Standard_Boolean CheckParameter(const Standard_Real theParam) const
{
return ((myFirst <= theParam) && (theParam <= myLast));
}
const Adaptor3d_Curve& myCurve1;
const Adaptor3d_Curve& myCurve2;
const Standard_Real myFirst;
const Standard_Real myLast;
};
static
void MinComputing(BRepLib_CheckCurveOnSurface_GlobOptFunc& theFunction,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theEpsilon,
Standard_Real& theBestValue,
Standard_Real& theBestParameter);
//=======================================================================
//class : BRepLib_CheckCurveOnSurface_Local
//purpose : Created for parallelization possibility only
//=======================================================================
class BRepLib_CheckCurveOnSurface_Local
{
public:
BRepLib_CheckCurveOnSurface_Local(
const Handle(Geom_Curve)& theCurve3D,
const Handle(Geom2d_Curve)& theCurve2D,
const Handle(Geom_Surface)& theSurface,
const TColStd_Array1OfReal& theIntervalsArr,
const Standard_Real theEpsilonRange,
const Standard_Integer theNbParticles):
myCurve3D(theCurve3D),
myCurve2D(theCurve2D),
mySurface(theSurface),
mySubIntervals(theIntervalsArr),
myEpsilonRange(theEpsilonRange),
myNbParticles(theNbParticles),
myArrOfDist(theIntervalsArr.Lower(), theIntervalsArr.Upper()-1),
myArrOfParam(theIntervalsArr.Lower(), theIntervalsArr.Upper()-1)
{
}
void operator()(const Standard_Integer& theIndex) const
{
//For every sub-interval (which is set by mySubIntervals array) this method
//computes optimal value of BRepLib_CheckCurveOnSurface_TargetFunc function.
//This optimal value will be put in corresponding (depending on theIndex - the
//identificator of the current interval in mySubIntervals array) cell of
//myArrOfDist and myArrOfParam arrays.
const GeomAdaptor_Curve anAC(myCurve3D);
const Handle(Adaptor2d_HCurve2d) anAd2dC = new Geom2dAdaptor_GHCurve(myCurve2D);
const Handle(Adaptor3d_HSurface) anAdS = new GeomAdaptor_HSurface(mySurface);
const Adaptor3d_CurveOnSurface anACS(anAd2dC, anAdS);
BRepLib_CheckCurveOnSurface_TargetFunc aFunc( anAC, anACS,
mySubIntervals.Value(theIndex),
mySubIntervals.Value(theIndex+1));
Standard_Real aMinDist = RealLast(), aPar = 0.0;
if(!MinComputing(aFunc, myEpsilonRange, myNbParticles, aMinDist, aPar))
{
myArrOfDist(theIndex) = RealLast();
myArrOfParam(theIndex) = aFunc.FirstParameter();
return;
}
myArrOfDist(theIndex) = aMinDist;
myArrOfParam(theIndex) = aPar;
}
//Returns optimal value (inverse of square of maximal distance)
void OptimalValues(Standard_Real& theMinimalValue, Standard_Real& theParameter) const
{
//This method looks for the minimal value of myArrOfDist.
const Standard_Integer aStartInd = myArrOfDist.Lower();
theMinimalValue = myArrOfDist(aStartInd);
theParameter = myArrOfParam(aStartInd);
for(Standard_Integer i = aStartInd + 1; i <= myArrOfDist.Upper(); i++)
{
if(myArrOfDist(i) < theMinimalValue)
{
theMinimalValue = myArrOfDist(i);
theParameter = myArrOfParam(i);
}
}
}
private:
BRepLib_CheckCurveOnSurface_Local operator=(BRepLib_CheckCurveOnSurface_Local&);
const Handle(Geom_Curve)& myCurve3D;
const Handle(Geom2d_Curve)& myCurve2D;
const Handle(Geom_Surface)& mySurface;
const TColStd_Array1OfReal& mySubIntervals;
const Standard_Real myEpsilonRange;
const Standard_Integer myNbParticles;
mutable NCollection_Array1<Standard_Real> myArrOfDist;
mutable NCollection_Array1<Standard_Real> myArrOfParam;
};
//=======================================================================
//function : BRepLib_CheckCurveOnSurface
@@ -185,7 +327,7 @@ BRepLib_CheckCurveOnSurface::BRepLib_CheckCurveOnSurface()
myFirst(0.),
myLast(0.),
myErrorStatus(0),
myMaxDistance(0.),
myMaxDistance(RealLast()),
myMaxParameter(0.)
{
}
@@ -199,7 +341,7 @@ BRepLib_CheckCurveOnSurface::BRepLib_CheckCurveOnSurface
const TopoDS_Face& theFace)
:
myErrorStatus(0),
myMaxDistance(0.),
myMaxDistance(RealLast()),
myMaxParameter(0.)
{
Init(theEdge, theFace);
@@ -217,7 +359,7 @@ BRepLib_CheckCurveOnSurface::BRepLib_CheckCurveOnSurface
const Standard_Real theLast)
:
myErrorStatus(0),
myMaxDistance(0.),
myMaxDistance(RealLast()),
myMaxParameter(0.)
{
Init(the3DCurve, the2DCurve, theSurface, theFirst, theLast);
@@ -231,6 +373,16 @@ void BRepLib_CheckCurveOnSurface::Init
(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace)
{
myCurve.Nullify();
myPCurve.Nullify();
myPCurve2.Nullify();
mySurface.Nullify();
myErrorStatus = 0;
myMaxDistance = RealLast();
myMaxParameter = 0.0;
myFirst = 0.0;
myLast = 0.0;
if (theEdge.IsNull() || theFace.IsNull()) {
return;
}
@@ -240,69 +392,22 @@ void BRepLib_CheckCurveOnSurface::Init
return;
}
//
Standard_Boolean isPCurveFound;
TopLoc_Location aLocE, aLocF, aLocC2D;
//
// 3D curve initialization
myCurve = Handle(Geom_Curve)::
DownCast(BRep_Tool::Curve(theEdge, aLocE, myFirst, myLast)->Copy());
myCurve->Transform(aLocE.Transformation());
//
const Handle(Geom_Curve)& aC = BRep_Tool::Curve(theEdge, aLocE, myFirst, myLast);
myCurve = Handle(Geom_Curve)::DownCast(aC->Transformed(aLocE.Transformation()));
// Surface initialization
const Handle(Geom_Surface)& aS = BRep_Tool::Surface(theFace, aLocF);
mySurface = Handle(Geom_Surface)::
DownCast(aS->Copy()->Transformed(aLocF.Transformation()));
mySurface = Handle(Geom_Surface)::DownCast(aS->Transformed(aLocF.Transformation()));
//
// 2D curves initialization
isPCurveFound = Standard_False;
aLocC2D = aLocF.Predivided(aLocE);
const Handle(BRep_TEdge)& aTE = *((Handle(BRep_TEdge)*)&theEdge.TShape());
BRep_ListIteratorOfListOfCurveRepresentation itcr(aTE->Curves());
//
for (; itcr.More(); itcr.Next()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(aS, aLocC2D)) {
isPCurveFound = Standard_True;
myPCurve = cr->PCurve();
//
if (cr->IsCurveOnClosedSurface()) {
myPCurve2 = cr->PCurve2();
}
break;
}
}
//
if (isPCurveFound) {
return;
}
//
Handle(Geom_Plane) aPlane;
Handle(Standard_Type) dtyp = mySurface->DynamicType();
//
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
aPlane = Handle(Geom_Plane)::
DownCast(Handle(Geom_RectangularTrimmedSurface)::
DownCast(mySurface)->BasisSurface()->Copy());
}
else {
aPlane = Handle(Geom_Plane)::DownCast(mySurface->Copy());
}
//
if (aPlane.IsNull()) { // not a plane
return;
}
//
aPlane = Handle(Geom_Plane)::DownCast(aPlane);
//
Handle(GeomAdaptor_HSurface) aGAHS = new GeomAdaptor_HSurface(aPlane);
Handle(Geom_Curve) aProjOnPlane =
GeomProjLib::ProjectOnPlane (new Geom_TrimmedCurve(myCurve, myFirst, myLast),
aPlane, aPlane->Position().Direction(),
Standard_True);
Handle(GeomAdaptor_HCurve) aHCurve = new GeomAdaptor_HCurve(aProjOnPlane);
//
ProjLib_ProjectedCurve aProj(aGAHS, aHCurve);
myPCurve = Geom2dAdaptor::MakeCurve(aProj);
myPCurve = BRep_Tool::CurveOnSurface(theEdge, theFace, myFirst, myLast);
if(BRep_Tool::IsClosed(theEdge, theFace))
myPCurve2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(theEdge.Reversed()),
theFace, myFirst, myLast);
}
//=======================================================================
@@ -318,32 +423,46 @@ void BRepLib_CheckCurveOnSurface::Init
{
myCurve = the3DCurve;
myPCurve = the2DCurve;
myPCurve2.Nullify();
mySurface = theSurface;
myFirst = theFirst;
myLast = theLast;
myErrorStatus = 0;
myMaxDistance = RealLast();
myMaxParameter = 0.0;
}
//=======================================================================
//function : Perform
//purpose :
//purpose : if isTheMTDisabled == TRUE parallelization is not used
//=======================================================================
void BRepLib_CheckCurveOnSurface::Perform()
#ifndef HAVE_TBB
//After fixing bug # 26365, this fragment should be deleted
//(together the text "#ifdef HAVE_TBB")
void BRepLib_CheckCurveOnSurface::Perform(const Standard_Boolean)
{
const Standard_Boolean isTheMTDisabled = Standard_True;
#else
void BRepLib_CheckCurveOnSurface::Perform(const Standard_Boolean isTheMTDisabled)
{
#endif
try {
OCC_CATCH_SIGNALS
//
// 1. Check data
CheckData();
if (myErrorStatus) {
return;
}
//
// 2. Compute the max distance
Compute(myPCurve);
Compute(myPCurve, isTheMTDisabled);
//
if (!myPCurve2.IsNull()) {
// compute max distance for myPCurve2
// (for the second curve on closed surface)
Compute(myPCurve2);
Compute(myPCurve2, isTheMTDisabled);
}
}
catch (Standard_Failure) {
@@ -353,108 +472,252 @@ void BRepLib_CheckCurveOnSurface::Perform()
//=======================================================================
//function : Compute
//purpose :
//purpose : if isTheMTDisabled == TRUE parallelization is not used
//=======================================================================
void BRepLib_CheckCurveOnSurface::Compute
(const Handle(Geom2d_Curve)& thePCurve)
void BRepLib_CheckCurveOnSurface::Compute(const Handle(Geom2d_Curve)& thePCurve,
const Standard_Boolean isTheMTDisabled)
{
Standard_Integer aNbIt, aStatus;
Standard_Real anEpsilonRange, aMinDelta;
Standard_Real aFirst, aLast;
Standard_Real aValue, aParam, aBP;
Standard_Real theMaxDist, theMaxPar;
//
anEpsilonRange = 1.e-3;
aMinDelta = 1.e-5;
aFirst = myFirst;
aLast = myLast;
//
BRepLib_CheckCurveOnSurface_GlobOptFunc aFunc
(myCurve, thePCurve, mySurface, myFirst, myLast);
//
math_Vector anOutputParam(1, 1);
anOutputParam(1) = aFirst;
theMaxDist = 0.;
theMaxPar = aFirst;
aNbIt = 100;
aStatus = Standard_True;
//
MinComputing(aFunc, aFirst, aLast, anEpsilonRange, theMaxDist, theMaxPar);
//
while((aNbIt-- >= 0) && aStatus) {
aValue = theMaxDist;
aParam = theMaxPar;
aBP = theMaxPar - aMinDelta;
const Standard_Real anEpsilonRange = 1.e-3;
if((aBP - aFirst) > Precision::PConfusion())
MinComputing(aFunc, aFirst, aBP, anEpsilonRange, theMaxDist, theMaxPar);
//
if(theMaxDist < aValue) {
aLast = aBP;
aStatus = Standard_True;
}
else {
theMaxDist = aValue;
theMaxPar = aParam;
aStatus = Standard_False;
}
//
if(!aStatus) {
aBP = theMaxPar + aMinDelta;
Standard_Integer aNbParticles = 3;
if((aLast - aBP) > Precision::PConfusion())
MinComputing(aFunc, aBP, aLast, 1.0e-3, theMaxDist, theMaxPar);
//
if(theMaxDist < aValue) {
aFirst = aBP;
aStatus = Standard_True;
}
else {
theMaxDist = aValue;
theMaxPar = aParam;
aStatus = Standard_False;
}
}
}
//
theMaxDist = sqrt(Abs(theMaxDist));
if (theMaxDist > myMaxDistance) {
myMaxDistance = theMaxDist;
myMaxParameter = theMaxPar;
}
}
//Polynomial function with degree n has not more than n-1 maxima and
//minima (degree of 1st derivative is equal to n-1 => 1st derivative has
//no greater than n-1 roots). Consequently, this function has
//maximum n monotonicity intervals. That is a good idea to try to put
//at least one particle in every monotonicity interval. Therefore,
//number of particles should be equal to n.
//=======================================================================
// Function : MinComputing
// purpose :
//=======================================================================
void MinComputing
(BRepLib_CheckCurveOnSurface_GlobOptFunc& theFunction,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theEpsilon, //1.0e-3
Standard_Real& theBestValue,
Standard_Real& theBestParameter)
{
const Standard_Real aStepMin = 1.0e-2;
math_Vector aFirstV(1, 1), aLastV(1, 1), anOutputParam(1, 1);
aFirstV(1) = theFirst;
aLastV(1) = theLast;
//
math_GlobOptMin aFinder(&theFunction, aFirstV, aLastV);
aFinder.SetTol(aStepMin, theEpsilon);
aFinder.Perform();
//
const Standard_Integer aNbExtr = aFinder.NbExtrema();
for(Standard_Integer i = 1; i <= aNbExtr; i++)
const Standard_Integer aNbSubIntervals =
FillSubIntervals( myCurve, thePCurve,
myFirst, myLast, aNbParticles);
if(!aNbSubIntervals)
{
Standard_Real aValue = 0.0;
aFinder.Points(i, anOutputParam);
theFunction.Value(anOutputParam, aValue);
//
if(aValue < theBestValue) {
theBestValue = aValue;
theBestParameter = anOutputParam(1);
myErrorStatus = 3;
return;
}
TColStd_Array1OfReal anIntervals(1, aNbSubIntervals+1);
FillSubIntervals(myCurve, thePCurve, myFirst, myLast, aNbParticles, &anIntervals);
BRepLib_CheckCurveOnSurface_Local aComp(myCurve, thePCurve,
mySurface, anIntervals, anEpsilonRange, aNbParticles);
OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp, isTheMTDisabled);
aComp.OptimalValues(myMaxDistance, myMaxParameter);
myMaxDistance = sqrt(Abs(myMaxDistance));
}
//=======================================================================
// Function : FillSubIntervals
// purpose : Divides [theFirst, theLast] interval on parts
// in order to make searching-algorithm more precisely
// (fills theSubIntervals array).
// Returns number of subintervals.
//=======================================================================
Standard_Integer FillSubIntervals(const Handle(Geom_Curve)& theCurve3d,
const Handle(Geom2d_Curve)& theCurve2d,
const Standard_Real theFirst,
const Standard_Real theLast,
Standard_Integer &theNbParticles,
TColStd_Array1OfReal* const theSubIntervals)
{
const Standard_Real anArrTempC[2] = {theFirst, theLast};
const TColStd_Array1OfReal anArrTemp(anArrTempC[0], 1, 2);
theNbParticles = 3;
Handle(Geom2d_BSplineCurve) aBS2DCurv;
Handle(Geom_BSplineCurve) aBS3DCurv;
//
if (theCurve3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
{
aBS3DCurv = Handle(Geom_BSplineCurve)::
DownCast(Handle(Geom_TrimmedCurve)::
DownCast(theCurve3d)->BasisCurve());
}
else
{
aBS3DCurv = Handle(Geom_BSplineCurve)::DownCast(theCurve3d);
}
if (theCurve2d->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
{
aBS2DCurv = Handle(Geom2d_BSplineCurve)::
DownCast(Handle(Geom2d_TrimmedCurve)::
DownCast(theCurve2d)->BasisCurve());
}
else
{
aBS2DCurv = Handle(Geom2d_BSplineCurve)::DownCast(theCurve2d);
}
const TColStd_Array1OfReal &anArrKnots3D = !aBS3DCurv.IsNull() ?
aBS3DCurv->Knots() :
anArrTemp;
const TColStd_Array1OfReal &anArrKnots2D = !aBS2DCurv.IsNull() ?
aBS2DCurv->Knots() :
anArrTemp;
Standard_Integer aNbSubIntervals = 1;
try
{
OCC_CATCH_SIGNALS
const Standard_Integer anIndMax3D = anArrKnots3D.Upper(),
anIndMax2D = anArrKnots2D.Upper();
Standard_Integer anIndex3D = anArrKnots3D.Lower(),
anIndex2D = anArrKnots2D.Lower();
if(theSubIntervals)
theSubIntervals->ChangeValue(aNbSubIntervals) = theFirst;
while((anIndex3D <= anIndMax3D) && (anIndex2D <= anIndMax2D))
{
const Standard_Real aVal3D = anArrKnots3D.Value(anIndex3D),
aVal2D = anArrKnots2D.Value(anIndex2D);
const Standard_Real aDelta = aVal3D - aVal2D;
if(aDelta < Precision::PConfusion())
{//aVal3D <= aVal2D
if((aVal3D > theFirst) && (aVal3D < theLast))
{
aNbSubIntervals++;
if(theSubIntervals)
theSubIntervals->ChangeValue(aNbSubIntervals) = aVal3D;
}
anIndex3D++;
if(-aDelta < Precision::PConfusion())
{//aVal3D == aVal2D
anIndex2D++;
}
}
else
{//aVal2D < aVal3D
if((aVal2D > theFirst) && (aVal2D < theLast))
{
aNbSubIntervals++;
if(theSubIntervals)
theSubIntervals->ChangeValue(aNbSubIntervals) = aVal2D;
}
anIndex2D++;
}
}
if(theSubIntervals)
theSubIntervals->ChangeValue(aNbSubIntervals+1) = theLast;
if(!aBS3DCurv.IsNull())
{
theNbParticles = Max(theNbParticles, aBS3DCurv->Degree());
}
if(!aBS2DCurv.IsNull())
{
theNbParticles = Max(theNbParticles, aBS2DCurv->Degree());
}
}
catch(Standard_Failure)
{
#ifdef OCCT_DEBUG
cout << "ERROR! BRepLib_CheckCurveOnSurface.cxx, "
"FillSubIntervals(): Incorrect filling!" << endl;
#endif
aNbSubIntervals = 0;
}
return aNbSubIntervals;
}
//=======================================================================
//class : MinComputing
//purpose : Performs computing minimal value
//=======================================================================
Standard_Boolean MinComputing (
BRepLib_CheckCurveOnSurface_TargetFunc& theFunction,
const Standard_Real theEpsilon, //1.0e-3
const Standard_Integer theNbParticles,
Standard_Real& theBestValue,
Standard_Real& theBestParameter)
{
try
{
OCC_CATCH_SIGNALS
//They are used for finding a position of theNbParticles worst places
const Standard_Integer aNbControlPoints = 3*theNbParticles;
//
math_Vector aParInf(1, 1), aParSup(1, 1), anOutputParam(1, 1), aStepPar(1,1);
aParInf(1) = theFunction.FirstParameter();
aParSup(1) = theFunction.LastParameter();
theBestParameter = aParInf(1);
theBestValue = RealLast();
const Standard_Real aDeltaParam = aParSup(1) - aParInf(1);
if(aDeltaParam < Precision::PConfusion())
return Standard_False;
aStepPar(1) = theEpsilon*aDeltaParam;
math_PSOParticlesPool aParticles(theNbParticles, 1);
const Standard_Real aStep = aDeltaParam/(aNbControlPoints-1);
Standard_Integer aCount = 1;
for(Standard_Real aPrm = aParInf(1); aCount <= aNbControlPoints; aCount++,
aPrm = (aCount == aNbControlPoints)? aParSup(1) : aPrm+aStep)
{
Standard_Real aVal = RealLast();
theFunction.Value(aPrm, aVal);
PSO_Particle* aParticle = aParticles.GetWorstParticle();
if(aVal > aParticle->BestDistance)
continue;
aParticle->Position[0] = aPrm;
aParticle->BestPosition[0] = aPrm;
aParticle->Distance = aVal;
aParticle->BestDistance = aVal;
}
math_PSO aPSO(&theFunction, aParInf, aParSup, aStepPar);
aPSO.Perform(aParticles, theNbParticles, theBestValue, anOutputParam);
//Here, anOutputParam contains parameter, which is near to optimal.
//It needs to be more precise. Precision is made by math_NewtonMinimum.
math_NewtonMinimum anA(theFunction);
anA.Perform(theFunction, anOutputParam);
if(!anA.IsDone())
{
#ifdef OCCT_DEBUG
cout << "BRepLib_CheckCurveOnSurface::Compute(): No solution found!" << endl;
#endif
return Standard_False;
}
anA.Location(anOutputParam);
theBestParameter = anOutputParam(1);
theBestValue = anA.Minimum();
}
catch(Standard_Failure)
{
#ifdef OCCT_DEBUG
cout << "BRepLib_CheckCurveOnSurface.cxx: Exception in MinComputing()!" << endl;
#endif
return Standard_False;
}
return Standard_True;
}

View File

@@ -773,7 +773,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
GeomAdaptor_Curve aCA(C);
TopoDS_Vertex V1,V2;
if (periodic) {
@@ -813,14 +813,15 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Boolean p1inf = Precision::IsNegativeInfinite(p1);
Standard_Boolean p2inf = Precision::IsPositiveInfinite(p2);
gp_Pnt P1,P2;
if (!p1inf) P1 = C->Value(p1);
if (!p2inf) P2 = C->Value(p2);
if (!p1inf) P1 = aCA.Value(p1);
if (!p2inf) P2 = aCA.Value(p2);
Standard_Real preci = BRepLib::Precision();
BRep_Builder B;
// check for closed curve
Standard_Boolean closed = Standard_False;
Standard_Boolean degenerated = Standard_False;
if (!p1inf && !p2inf)
closed = (P1.Distance(P2) <= preci);
@@ -836,13 +837,19 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
V2 = V1;
else {
if (!V1.IsSame(V2)) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
}
else if (P1.Distance(BRep_Tool::Pnt(V1)) >
Max(preci,BRep_Tool::Tolerance(V1))) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
Max(preci,BRep_Tool::Tolerance(V1))) {
myError = BRepLib_DifferentPointsOnClosedCurve;
return;
}
else
{
gp_Pnt PM = aCA.Value((p1+p2)/2);
if (P1.Distance(PM) < preci)
degenerated = Standard_True;
}
}
}
@@ -898,6 +905,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
B.Add(E,V2);
}
B.Range(E,p1,p2);
B.Degenerated(E, degenerated);
myError = BRepLib_EdgeDone;
Done();

View File

@@ -32,7 +32,8 @@ BRepMesh_EdgeParameterProvider::BRepMesh_EdgeParameterProvider(
const Handle(TColStd_HArray1OfReal)& theParameters)
: myParameters(theParameters),
myIsSameParam(BRep_Tool::SameParameter(theEdge)),
myScale(1.)
myScale(1.),
myCurveAdaptor(theEdge, theFace)
{
if (myIsSameParam)
return;
@@ -58,9 +59,8 @@ BRepMesh_EdgeParameterProvider::BRepMesh_EdgeParameterProvider(
(aOldLastParam - myOldFirstParam);
}
BRepAdaptor_Curve aCOnS(theEdge, theFace);
myProjector.Initialize(aCOnS, aCOnS.FirstParameter(),
aCOnS.LastParameter(), Precision::PConfusion());
myProjector.Initialize(myCurveAdaptor, myCurveAdaptor.FirstParameter(),
myCurveAdaptor.LastParameter(), Precision::PConfusion());
}
//=======================================================================

View File

@@ -20,6 +20,7 @@
#include <Standard_DefineAlloc.hxx>
#include <Extrema_LocateExtPC.hxx>
#include <Handle_TColStd_HArray1OfReal.hxx>
#include <BRepAdaptor_Curve.hxx>
class gp_Pnt;
class TopoDS_Edge;
@@ -63,6 +64,7 @@ private:
Standard_Real myCurParam;
Standard_Real myFoundParam;
BRepAdaptor_Curve myCurveAdaptor;
Extrema_LocateExtPC myProjector;
};

View File

@@ -72,7 +72,11 @@ is
UnCorrectClosingFace,
ExtentFaceFailed,
RadiusEqualOffset,
UnknownError
UnknownError,
BadNormalsOnGeometry,
C0Geometry,
NullOffset,
NotConnectedShell
end Error;
class MakeOffset;

View File

@@ -173,7 +173,7 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
myShape = S;
angle = Angle;
Standard_Real SinTol = sin(Angle);
Standard_Real SinTol = Sin(Angle);
// Build ancestors.
BuildAncestors (S,ancestors);

View File

@@ -136,6 +136,19 @@ is
returns IndexedMapOfShape from TopTools
is static;
CheckInputData(me: in out) returns Boolean;
---Purpose: Makes pre analysis of possibility offset perform. Use method Error() to get more information.
--- Finds first error. List of checks:
--- 1) Check for existence object with non-null offset.
--- 2) Check for connectivity in offset shell.
--- 3) Check continuity of input surfaces.
--- 4) Check for normals existence on grid.
--- @return 1 if possible make computations and 0 if not possible.
GetBadShape (me) returns Shape from TopoDS;
---Purpose: Return bad shape, which obtained in CheckInputData.
---C++: return const &
---Category: private methods
BuildOffsetByArc ( me : in out )
@@ -224,5 +237,8 @@ fields
myError : Error from BRepOffset;
myMakeLoops : MakeLoops from BRepOffset;
myBadShape : Shape from TopoDS;
myIsPerformSewing: Boolean from Standard; -- Handle bad walls in thicksolid mode.
end MakeOffset;

View File

@@ -112,10 +112,15 @@
#include <Geom_Plane.hxx>
#include <IntTools_FClass2d.hxx>
#include <BRepLib_FindSurface.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <NCollection_List.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
// POP for NT
#include <stdio.h>
#include <NCollection_Vector.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <Geom_Line.hxx>
#ifdef DRAW
@@ -238,11 +243,13 @@ static void DEBVerticesControl (const TopTools_IndexedMapOfShape& NewEdges,
}
#endif
//---------------------------------------------------------------------
static void UpdateTolerance ( TopoDS_Shape& myShape,
const TopTools_IndexedMapOfShape& myFaces);
static void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList);
//---------------------------------------------------------------------
//
static Standard_Boolean FindParameter(const TopoDS_Vertex& V,
const TopoDS_Edge& E,
Standard_Real& U)
@@ -459,6 +466,10 @@ static void FillContours(const TopoDS_Shape& aShape,
}
}
//
//-----------------------------------------------------------------------
//
//=======================================================================
//function : BRepOffset_MakeOffset
//purpose :
@@ -523,6 +534,7 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape& S,
myJoin = Join;
myThickening = Thickening;
myDone = Standard_False;
myIsPerformSewing = Standard_False;
Clear();
}
@@ -656,10 +668,9 @@ static void EvalMax(const TopoDS_Shape& S, Standard_Real& Tol)
Standard_Real TolV = BRep_Tool::Tolerance(V);
if (TolV > Tol) Tol = TolV;
}
//Patch
Tol *= 5.;
}
//=======================================================================
//function : MakeOffsetShape
//purpose :
@@ -667,27 +678,32 @@ static void EvalMax(const TopoDS_Shape& S, Standard_Real& Tol)
void BRepOffset_MakeOffset::MakeOffsetShape()
{
myDone = Standard_False;
myDone = Standard_False;
//------------------------------------------
// Construction of myShape without caps.
//------------------------------------------
RemoveCorks (myShape,myFaces);
if (! IsConnectedShell(myShape))
Standard_ConstructionError::Raise("BRepOffset_MakeOffset : Incorrect set of faces to remove, the remaining shell is not connected");
if(!myFaces.IsEmpty())
{
RemoveCorks (myShape,myFaces);
}
if (Abs(myOffset) < myTol) return;
if (!CheckInputData())
{
// There is error in input data.
// Check Error() method.
return;
}
TopAbs_State Side = TopAbs_IN;
if (myOffset < 0.) Side = TopAbs_OUT;
// ------------
// Preanalyse.
// ------------
EvalMax(myShape,myTol);
if (myTol > Abs(myOffset*0.5)) {
Standard_ConstructionError::Raise("BRepOffset_MakeOffset : Tol > Offset");
}
Standard_Real TolAngle = 4*ASin(myTol/Abs(myOffset*0.5));
// There are possible second variant: analytical continuation of arcsin.
Standard_Real TolAngleCoeff = Min(myTol / (Abs(myOffset * 0.5) + Precision::Confusion()), 1.0);
Standard_Real TolAngle = 4*ASin(TolAngleCoeff);
myAnalyse.Perform(myShape,TolAngle);
//---------------------------------------------------
// Construction of Offset from preanalysis.
@@ -757,6 +773,14 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
CorrectConicalFaces();
if (myIsPerformSewing)
{
BRepBuilderAPI_Sewing aSew(myTol);
aSew.Add(myOffsetShape);
aSew.Perform();
myOffsetShape = aSew.SewedShape();
}
myDone = Standard_True;
}
@@ -1032,12 +1056,12 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
// Extension of neighbor edges of new edges and intersection between neighbors.
//--------------------------------------------------------------------------------
Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next())
{
const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
// Modified by skv - Mon Jan 12 11:50:02 2004 OCC4455 Begin
// BRepOffset_Inter2d::ConnexIntByInt (FI,MapSF(FI),MES,Build,AsDes2d,myTol);
BRepOffset_Inter2d::ConnexIntByInt (FI,MapSF(FI),MES,Build,AsDes2d,myOffset, myTol);
// Modified by skv - Mon Jan 12 11:50:03 2004 OCC4455 End
Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(FI);
BRepOffset_Inter2d::ConnexIntByInt (FI, MapSF(FI), MES, Build,
AsDes2d, myOffset, aCurrFaceTol);
}
//-----------------------------------------------------------
// Great restriction of new edges and update of AsDes.
@@ -1113,17 +1137,21 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
}
TopTools_ListIteratorOfListOfShape itLFE(LFE);
for (; itLFE.More(); itLFE.Next()) {
for (; itLFE.More(); itLFE.Next())
{
const TopoDS_Face& NEF = TopoDS::Face(itLFE.Value());
BRepOffset_Inter2d::Compute(AsDes,NEF,NewEdges,myTol);
Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(NEF);
BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol);
}
//----------------------------------------------
// Intersections 2d on caps.
//----------------------------------------------
Standard_Integer i;
for (i = 1; i <= myFaces.Extent(); i++) {
for (i = 1; i <= myFaces.Extent(); i++)
{
const TopoDS_Face& Cork = TopoDS::Face(myFaces(i));
BRepOffset_Inter2d::Compute(AsDes,Cork,NewEdges,myTol);
Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(Cork);
BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol);
}
//-------------------------------
@@ -1842,6 +1870,11 @@ void BRepOffset_MakeOffset::UpdateFaceOffset()
void BRepOffset_MakeOffset::CorrectConicalFaces()
{
if(myOffsetShape.IsNull())
{
return;
}
//
TopTools_SequenceOfShape Cones;
TopTools_SequenceOfShape Circs;
TopTools_SequenceOfShape Seams;
@@ -1909,6 +1942,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Cone(FacesOfCone);
BRep_Builder BB;
TopLoc_Location L;
Standard_Boolean IsModified = Standard_False;
for (; Cone.More(); Cone.Next() ) {
gp_Sphere theSphere;
Handle(Geom_SphericalSurface) aSphSurf;
@@ -2155,40 +2189,108 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
TopoDS_Shape theShell = Explo.Current();
theShell.Free( Standard_True );
BB.Add( theShell, NewSphericalFace );
IsModified = Standard_True;
if(!theShell.Closed())
{
if(BRep_Tool::IsClosed(theShell))
{
theShell.Closed(Standard_True);
}
}
}
//
if(!IsModified)
{
return;
}
//
if (myShape.ShapeType() == TopAbs_SOLID || myThickening)
{
Explo.Init( myOffsetShape, TopAbs_SHELL );
if (Explo.More()) {
TopoDS_Shape theShell = Explo.Current();
theShell.Closed( Standard_True );
}
//Explo.Init( myOffsetShape, TopAbs_SHELL );
//if (Explo.More()) {
// TopoDS_Shape theShell = Explo.Current();
// theShell.Closed( Standard_True );
//}
Standard_Integer NbShell = 0;
TopoDS_Compound NC;
TopoDS_Shape S1;
BB.MakeCompound (NC);
TopoDS_Solid Sol;
BB.MakeSolid(Sol);
Sol.Closed(Standard_True);
for (Explo.Init(myOffsetShape,TopAbs_SHELL); Explo.More(); Explo.Next()) {
const TopoDS_Shell& Sh = TopoDS::Shell(Explo.Current());
TopoDS_Shell Sh = TopoDS::Shell(Explo.Current());
//if (myThickening && myOffset > 0.)
// Sh.Reverse();
NbShell++;
if (Sh.Closed()) {
TopoDS_Solid Sol;
BB.MakeSolid (Sol);
BB.Add (Sol,Sh);
Sol.Closed(Standard_True);
BB.Add (NC,Sol);
if (NbShell == 1) S1 = Sol;
BB.Add(Sol,Sh);
}
else {
BB.Add (NC,Sh);
if (NbShell == 1) S1 = Sh;
if(NbShell == 1)
{
S1 = Sh;
}
}
}
if (NbShell == 1) myOffsetShape = S1;
else myOffsetShape = NC;
TopoDS_Iterator anIt(Sol);
Standard_Boolean SolIsNull = !anIt.More();
//Checking solid
if(!SolIsNull)
{
Standard_Integer nbs = 0;
while(anIt.More()) {anIt.Next(); ++nbs;}
if(nbs > 1)
{
BRepCheck_Analyzer aCheck(Sol, Standard_False);
if(!aCheck.IsValid())
{
TopTools_ListOfShape aSolList;
CorrectSolid(Sol, aSolList);
if(!aSolList.IsEmpty())
{
BB.Add(NC, Sol);
TopTools_ListIteratorOfListOfShape aSLIt(aSolList);
for(; aSLIt.More(); aSLIt.Next())
{
BB.Add(NC, aSLIt.Value());
}
SolIsNull = Standard_True;
}
}
}
}
//
anIt.Initialize(NC);
Standard_Boolean NCIsNull = !anIt.More();
if((!SolIsNull) && (!NCIsNull))
{
BB.Add(NC, Sol);
myOffsetShape = NC;
}
else if(SolIsNull && (!NCIsNull))
{
if (NbShell == 1)
{
myOffsetShape = S1;
}
else
{
myOffsetShape = NC;
}
}
else if((!SolIsNull) && NCIsNull)
{
myOffsetShape = Sol;
}
else
{
myOffsetShape = NC;
}
}
}
@@ -2392,7 +2494,6 @@ static void UpdateInitOffset (BRepAlgo_Image& myInitOffset,
//function : MakeMissingWalls
//purpose :
//=======================================================================
void BRepOffset_MakeOffset::MakeMissingWalls ()
{
TopTools_DataMapOfShapeListOfShape Contours; //Start vertex + list of connected edges (free boundary)
@@ -2411,23 +2512,59 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
Standard_Boolean FirstStep = Standard_True;
TopoDS_Edge PrevEdge;
TopoDS_Vertex PrevVertex = StartVertex;
Standard_Boolean isBuildFromScratch = Standard_False; // Problems with edges.
for (; itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
// Check for offset existence.
if (!myInitOffsetEdge.HasImage(anEdge))
continue;
//if (BRep_Tool::Degenerated(anEdge))
//continue;
TopoDS_Face aFace = TopoDS::Face(MapEF(anEdge));
//TopoDS_Edge OE = TopoDS::Edge(myInitOffsetEdge.Image(anEdge).First());
// Check for existence of two different vertices.
TopTools_ListOfShape LOE, LOE2;
myInitOffsetEdge.LastImage( anEdge, LOE );
myImageOffset.LastImage( LOE.Last(), LOE2 );
TopoDS_Edge OE = TopoDS::Edge( LOE2.Last() );
////////////////////////////////////////////////////////////////////////
TopoDS_Vertex V1, V2, V3, V4;
TopExp::Vertices(anEdge, V1, V2/*, Standard_True*/);
TopExp::Vertices(OE, V4, V3/*, Standard_True*/);
TopExp::Vertices(OE, V4, V3);
TopExp::Vertices(anEdge, V1, V2);
Standard_Real aF, aL;
const Handle(Geom_Curve) &aC = BRep_Tool::Curve(anEdge, aF, aL);
if (!aC.IsNull() &&
(!aC->IsClosed() && !aC->IsPeriodic()))
{
gp_Pnt aPntF = BRep_Tool::Pnt(V1);
gp_Pnt aPntL = BRep_Tool::Pnt(V2);
Standard_Real aDistE = aPntF.SquareDistance(aPntL);
if ( aDistE < Precision::SquareConfusion())
{
// Bad case: non closed, but vertexes mapped to same 3d point.
continue;
}
Standard_Real anEdgeTol = BRep_Tool::Tolerance(anEdge);
if (aDistE < anEdgeTol)
{
// Potential problems not detected via checkshape.
gp_Pnt aPntOF = BRep_Tool::Pnt(V4);
gp_Pnt aPntOL = BRep_Tool::Pnt(V3);
if (aPntOF.SquareDistance(aPntOL) > gp::Resolution())
{
Standard_Real anAngle = gp_Vec(aPntF, aPntL).Angle(gp_Vec(aPntOF, aPntOL));
if (aC->DynamicType() == STANDARD_TYPE(Geom_Line) &&
Abs (anAngle - M_PI_2) < anEdgeTol) // For small values sin is equal to its argument.
{
// anEdge near perpendicular to offseting surface.
isBuildFromScratch = Standard_True;
myIsPerformSewing = Standard_True;
continue;
}
}
}
}
TopoDS_Face aFace = TopoDS::Face(MapEF(anEdge));
Standard_Boolean ToReverse = Standard_False;
if (!V1.IsSame(PrevVertex))
{
@@ -2435,23 +2572,30 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
aVtx = V3; V3 = V4; V4 = aVtx;
ToReverse = Standard_True;
}
//Temporary
//anEdge.Reverse();
OE.Orientation(TopAbs::Reverse(anEdge.Orientation()));
TopoDS_Edge E3, E4;
if (FirstStep)
Standard_Boolean ArcOnV2 = ((myJoin == GeomAbs_Arc) && (myInitOffsetEdge.HasImage(V2)));
if (FirstStep || isBuildFromScratch)
{
E4 = BRepLib_MakeEdge( V1, V4 );
if (FirstStep)
StartEdge = E4;
}
else
E4 = PrevEdge;
Standard_Boolean ArcOnV2 = ((myJoin == GeomAbs_Arc) && (myInitOffsetEdge.HasImage(V2)));
if (V2.IsSame(StartVertex) && !ArcOnV2)
E3 = StartEdge;
else
E3 = BRepLib_MakeEdge( V2, V3 );
E4.Reverse();
if (isBuildFromScratch)
{
E3.Reverse();
E4.Reverse();
}
TopoDS_Shape localAnEdge = anEdge.Oriented(TopAbs_FORWARD);
const TopoDS_Edge& anEdgeFWD = TopoDS::Edge(localAnEdge);
Standard_Real ParV1 = BRep_Tool::Parameter(V1, anEdgeFWD);
@@ -2473,6 +2617,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
BB.Add(theWire, OE);
BB.Add(theWire, E4);
}
BRepLib::BuildCurves3d( theWire, myTol );
theWire.Closed(Standard_True);
TopoDS_Face NewFace;
@@ -2752,9 +2897,18 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
}
else
{
if (isBuildFromScratch)
{
PrevEdge = TopoDS::Edge(E4);
PrevVertex = V1;
isBuildFromScratch = Standard_False;
}
else
{
PrevEdge = E3;
PrevVertex = V2;
}
}
FirstStep = Standard_False;
}
}
@@ -2788,16 +2942,30 @@ void BRepOffset_MakeOffset::MakeShells ()
}
if (myThickening)
{
TopExp_Explorer Explo(myShape, TopAbs_FACE);
for (; Explo.More(); Explo.Next())
Glue.Add(Explo.Current());
{
TopExp_Explorer Explo(myShape, TopAbs_FACE);
for (; Explo.More(); Explo.Next())
Glue.Add(Explo.Current());
for (it.Initialize(myWalls); it.More(); it.Next())
Glue.Add(it.Value());
}
for (it.Initialize(myWalls); it.More(); it.Next())
Glue.Add(it.Value());
}
myOffsetShape = Glue.Shells();
//
//Set correct value for closed flag
TopExp_Explorer Explo(myOffsetShape, TopAbs_SHELL);
for(; Explo.More(); Explo.Next())
{
TopoDS_Shape aS = Explo.Current();
if(!aS.Closed())
{
if(BRep_Tool::IsClosed(aS))
{
aS.Closed(Standard_True);
}
}
}
}
//=======================================================================
@@ -2821,26 +2989,79 @@ void BRepOffset_MakeOffset::MakeSolid ()
TopoDS_Shape S1;
B.MakeCompound (NC);
TopoDS_Solid Sol;
B.MakeSolid(Sol);
Sol.Closed(Standard_True);
Standard_Boolean aMakeSolid = (myShape.ShapeType() == TopAbs_SOLID) || myThickening;
for (exp.Init(myOffsetShape,TopAbs_SHELL); exp.More(); exp.Next()) {
TopoDS_Shell Sh = TopoDS::Shell(exp.Current());
if (myThickening && myOffset > 0.)
Sh.Reverse();
NbShell++;
if (Sh.Closed()) {
TopoDS_Solid Sol;
B.MakeSolid (Sol);
B.Add (Sol,Sh);
Sol.Closed(Standard_True);
B.Add (NC,Sol);
if (NbShell == 1) S1 = Sol;
if (Sh.Closed() && aMakeSolid) {
B.Add(Sol,Sh);
}
else {
B.Add (NC,Sh);
if (NbShell == 1) S1 = Sh;
if(NbShell == 1)
{
S1 = Sh;
}
}
}
if (NbShell == 1) myOffsetShape = S1;
else myOffsetShape = NC;
TopoDS_Iterator anIt(Sol);
Standard_Boolean SolIsNull = !anIt.More();
//Checking solid
if(!SolIsNull)
{
Standard_Integer nbs = 0;
while(anIt.More()) {anIt.Next(); ++nbs;}
if(nbs > 1)
{
BRepCheck_Analyzer aCheck(Sol, Standard_False);
if(!aCheck.IsValid())
{
TopTools_ListOfShape aSolList;
CorrectSolid(Sol, aSolList);
if(!aSolList.IsEmpty())
{
B.Add(NC, Sol);
TopTools_ListIteratorOfListOfShape aSLIt(aSolList);
for(; aSLIt.More(); aSLIt.Next())
{
B.Add(NC, aSLIt.Value());
}
SolIsNull = Standard_True;
}
}
}
}
anIt.Initialize(NC);
Standard_Boolean NCIsNull = !anIt.More();
if((!SolIsNull) && (!NCIsNull))
{
B.Add(NC, Sol);
myOffsetShape = NC;
}
else if(SolIsNull && (!NCIsNull))
{
if (NbShell == 1)
{
myOffsetShape = S1;
}
else
{
myOffsetShape = NC;
}
}
else if((!SolIsNull) && NCIsNull)
{
myOffsetShape = Sol;
}
else
{
myOffsetShape = NC;
}
}
//=======================================================================
@@ -2862,7 +3083,7 @@ void BRepOffset_MakeOffset::SelectShells ()
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(E);
if (LA.Extent() < 2) {
if (myAnalyse.Type(E).First().Type() == BRepOffset_FreeBoundary) {
FreeEdges.Add(E);
FreeEdges.Add(E);
}
}
}
@@ -3109,8 +3330,8 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
//purpose :
//=======================================================================
static void UpdateTolerance (TopoDS_Shape& S,
const TopTools_IndexedMapOfShape& Faces)
void UpdateTolerance (TopoDS_Shape& S,
const TopTools_IndexedMapOfShape& Faces)
{
BRep_Builder B;
TopTools_MapOfShape View;
@@ -3152,3 +3373,251 @@ static void UpdateTolerance (TopoDS_Shape& S,
}
}
//=======================================================================
//function : CorrectSolid
//purpose :
//=======================================================================
void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList)
{
BRep_Builder aBB;
TopoDS_Shape anOuterShell;
NCollection_List<Standard_Real> aVols;
Standard_Real aVolMax = 0., anOuterVol = 0.;
TopoDS_Iterator anIt(theSol);
for(; anIt.More(); anIt.Next())
{
const TopoDS_Shape& aSh = anIt.Value();
GProp_GProps aVProps;
BRepGProp::VolumeProperties(aSh, aVProps, Standard_True);
if(Abs(aVProps.Mass()) > aVolMax)
{
anOuterVol = aVProps.Mass();
aVolMax = Abs(anOuterVol);
anOuterShell = aSh;
}
aVols.Append(aVProps.Mass());
}
//
if(anOuterVol < 0.)
{
anOuterShell.Reverse();
}
TopoDS_Solid aNewSol;
aBB.MakeSolid(aNewSol);
aNewSol.Closed(Standard_True);
aBB.Add(aNewSol, anOuterShell);
BRepClass3d_SolidClassifier aSolClass(aNewSol);
//
anIt.Initialize(theSol);
NCollection_List<Standard_Real>::Iterator aVIt(aVols);
for(; anIt.More(); anIt.Next(), aVIt.Next())
{
TopoDS_Shell aSh = TopoDS::Shell(anIt.Value());
if(aSh.IsSame(anOuterShell))
{
continue;
}
else
{
TopExp_Explorer aVExp(aSh, TopAbs_VERTEX);
const TopoDS_Vertex& aV = TopoDS::Vertex(aVExp.Current());
gp_Pnt aP = BRep_Tool::Pnt(aV);
aSolClass.Perform(aP, BRep_Tool::Tolerance(aV));
if(aSolClass.State() == TopAbs_IN)
{
if(aVIt.Value() > 0.)
{
aSh.Reverse();
}
aBB.Add(aNewSol, aSh);
}
else
{
if(aVIt.Value() < 0.)
{
aSh.Reverse();
}
TopoDS_Solid aSol;
aBB.MakeSolid(aSol);
aSol.Closed(Standard_True);
aBB.Add(aSol, aSh);
theSolList.Append(aSol);
}
}
}
theSol = aNewSol;
}
//=======================================================================
//function : CheckInputData
//purpose : Check input data for possiblity of offset perform.
//=======================================================================
Standard_Boolean BRepOffset_MakeOffset::CheckInputData()
{
// Set initial error state.
myError = BRepOffset_NoError;
TopoDS_Shape aTmpShape;
myBadShape = aTmpShape;
// Non-null offset.
if (Abs(myOffset) <= myTol)
{
Standard_Boolean isFound = Standard_False;
TopTools_DataMapIteratorOfDataMapOfShapeReal anIter(myFaceOffset);
for( ; anIter.More(); anIter.Next())
{
if (Abs(anIter.Value()) > myTol)
{
isFound = Standard_True;
break;
}
}
if (!isFound)
{
// No face with non-null offset found.
myError = BRepOffset_NullOffset;
return Standard_False;
}
}
// Connectivity of input shape.
if (!IsConnectedShell(myShape))
{
myError = BRepOffset_NotConnectedShell;
return Standard_False;
}
// Normals check and continuity check.
const Standard_Integer aPntPerDim = 20; // 21 points on each dimension.
Standard_Real aUmin, aUmax, aVmin, aVmax;
TopExp_Explorer anExpSF(myShape, TopAbs_FACE);
TopLoc_Location L;
gp_Pnt2d aPnt2d;
gp_Pnt aPnt;
gp_Vec aD1U, aD1V;
for( ; anExpSF.More(); anExpSF.Next())
{
const TopoDS_Face& aF = TopoDS::Face(anExpSF.Current());
const Handle(Geom_Surface)& aSurf = BRep_Tool::Surface(aF, L);
BRepTools::UVBounds(aF, aUmin, aUmax, aVmin, aVmax);
// Continuity check.
if (aSurf->Continuity() == GeomAbs_C0)
{
myError = BRepOffset_C0Geometry;
return Standard_False;
}
// Get degenerated points, to avoid check them.
NCollection_Vector<gp_Pnt> aBad3dPnts;
TopExp_Explorer anExpFE(aF, TopAbs_EDGE);
for( ; anExpFE.More(); anExpFE.Next())
{
const TopoDS_Edge &aE = TopoDS::Edge(anExpFE.Current());
if (BRep_Tool::Degenerated(aE))
{
aBad3dPnts.Append(BRep_Tool::Pnt((TopExp::FirstVertex(aE))));
}
}
// Geometry grid check.
for(Standard_Integer i = 0; i <= aPntPerDim; i++)
{
Standard_Real aUParam = aUmin + (aUmax - aUmin) * i / aPntPerDim;
for(Standard_Integer j = 0; j <= aPntPerDim; j++)
{
Standard_Real aVParam = aVmin + (aVmax - aVmin) * j / aPntPerDim;
aSurf->D1(aUParam, aVParam, aPnt, aD1U, aD1V);
if (aD1U.SquareMagnitude() < Precision::SquareConfusion() ||
aD1V.SquareMagnitude() < Precision::SquareConfusion() )
{
Standard_Boolean isKnownBadPnt = Standard_False;
for(Standard_Integer anIdx = aBad3dPnts.Lower();
anIdx <= aBad3dPnts.Upper();
++anIdx)
{
if (aPnt.SquareDistance(aBad3dPnts(anIdx)) < Precision::SquareConfusion())
{
isKnownBadPnt = Standard_True;
break;
}
} // for(Standard_Integer anIdx = aBad3dPnts.Lower();
if (!isKnownBadPnt)
{
myError = BRepOffset_BadNormalsOnGeometry;
return Standard_False;
}
else
continue;
} // if (aD1U.SquareMagnitude() < Precision::SquareConfusion() ||
Standard_Real anAngle = aD1U.Angle(aD1V);
if (Abs (anAngle) < Precision::Confusion())
{
myError = BRepOffset_BadNormalsOnGeometry;
return Standard_False;
}
}
}
// Vertex list check.
TopExp_Explorer anExpFV(aF, TopAbs_VERTEX);
for( ; anExpFV.More(); anExpFV.Next())
{
const TopoDS_Vertex &aV = TopoDS::Vertex(anExpFV.Current());
aPnt2d = BRep_Tool::Parameters(aV, aF);
aSurf->D1(aPnt2d.X(), aPnt2d.Y(), aPnt, aD1U, aD1V);
if (aD1U.SquareMagnitude() < Precision::SquareConfusion() ||
aD1V.SquareMagnitude() < Precision::SquareConfusion() )
{
Standard_Boolean isKnownBadPnt = Standard_False;
for(Standard_Integer anIdx = aBad3dPnts.Lower();
anIdx <= aBad3dPnts.Upper();
++anIdx)
{
if (aPnt.SquareDistance(aBad3dPnts(anIdx)) < Precision::SquareConfusion())
{
isKnownBadPnt = Standard_True;
break;
}
} // for(Standard_Integer anIdx = aBad3dPnts.Lower();
if (!isKnownBadPnt)
{
myError = BRepOffset_BadNormalsOnGeometry;
return Standard_False;
}
else
continue;
} // if (aD1U.SquareMagnitude() < Precision::SquareConfusion() ||
Standard_Real anAngle = aD1U.Angle(aD1V);
if ( Abs (anAngle) < Precision::Confusion())
{
myError = BRepOffset_BadNormalsOnGeometry;
return Standard_False;
}
}
}
return Standard_True;
}
//=======================================================================
//function : CheckInputData
//purpose : Check input data for possiblity of offset perform.
//=======================================================================
const TopoDS_Shape& BRepOffset_MakeOffset::GetBadShape() const
{
return myBadShape;
}

View File

@@ -536,11 +536,29 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face,
TopTools_SequenceOfShape DegEdges;
TopExp_Explorer Explo(Face, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
if (BRep_Tool::Degenerated(anEdge))
DegEdges.Append(anEdge);
}
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
if (BRep_Tool::Degenerated(anEdge))
{
Standard_Real aF, aL;
Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface(anEdge, Face, aF, aL);
gp_Pnt2d aFPnt2d = c2d->Value(aF),
aLPnt2d = c2d->Value(aL);
gp_Pnt aFPnt = S->Value(aFPnt2d.X(), aFPnt2d.Y()),
aLPnt = S->Value(aLPnt2d.X(), aLPnt2d.Y());
// aFPnt.SquareDistance(aLPnt) > Precision::SquareConfusion() -
// is a sufficient condition of troubles: non-singular case, but edge is degenerated.
// So, normal handling of degenerated edges is not applicable in case of non-singular point.
if (aFPnt.SquareDistance(aLPnt) < Precision::SquareConfusion())
{
DegEdges.Append(anEdge);
}
}
}
if (!DegEdges.IsEmpty())
{
const Standard_Real TolApex = 1.e-5;
@@ -1639,6 +1657,3 @@ BRepOffset_Status BRepOffset_Offset::Status() const
{
return myStatus;
}

View File

@@ -1163,14 +1163,15 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1,
//=======================================================================
static TopoDS_Edge Glue(const TopoDS_Edge& E1,
const TopoDS_Edge& E2,
const TopoDS_Vertex& Vfirst,
const TopoDS_Vertex& Vlast,
const Standard_Boolean After,
const TopoDS_Face& F1,
const Standard_Boolean addPCurve1,
const TopoDS_Face& F2,
const Standard_Boolean addPCurve2)
const TopoDS_Edge& E2,
const TopoDS_Vertex& Vfirst,
const TopoDS_Vertex& Vlast,
const Standard_Boolean After,
const TopoDS_Face& F1,
const Standard_Boolean addPCurve1,
const TopoDS_Face& F2,
const Standard_Boolean addPCurve2,
const Standard_Real theGlueTol)
{
Standard_Real Tol = 1.e-7;
GeomAbs_Shape Continuity = GeomAbs_C1;
@@ -1208,7 +1209,7 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1,
Handle(Geom_TrimmedCurve) TC1 = new Geom_TrimmedCurve( C1, first1, last1 );
Handle(Geom_TrimmedCurve) TC2 = new Geom_TrimmedCurve( C2, first2, last2 );
GeomConvert_CompCurveToBSplineCurve Concat( TC1 );
Concat.Add( TC2, Precision::Confusion(), After );
Concat.Add( TC2, theGlueTol, After );
newCurve = Concat.BSplineCurve();
if (newCurve->Continuity() < GeomAbs_C1)
{
@@ -1496,6 +1497,7 @@ static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS,
const TopTools_SequenceOfShape& EdgesForConcat)
{
TopoDS_Edge CurEdge = TopoDS::Edge( EdgesForConcat(1) );
Standard_Real aGlueTol = Precision::Confusion();
for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
{
TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) );
@@ -1520,6 +1522,7 @@ static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS,
{
TopoDS_Vertex CV, V11, V12, V21, V22;
TopExp::CommonVertex( CurEdge, anEdge, CV );
aGlueTol = BRep_Tool::Tolerance(CV);
TopExp::Vertices( CurEdge, V11, V12 );
TopExp::Vertices( anEdge, V21, V22 );
if (V11.IsSame(CV) && V21.IsSame(CV))
@@ -1544,9 +1547,8 @@ static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS,
}
} //end of else (open wire)
TopoDS_Edge NewEdge = Glue(CurEdge, anEdge,
Vfirst, Vlast, After,
F1, addPCurve1, F2, addPCurve2);
TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After,
F1, addPCurve1, F2, addPCurve2, aGlueTol);
CurEdge = NewEdge;
} //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)

View File

@@ -389,7 +389,10 @@ void BRepOffsetAPI_MiddlePath::Build()
break;
}
}
myPaths.Append(Edges);
if (!Edges.IsEmpty())
myPaths.Append(Edges);
else
return;
}
//Filling of "myPaths"

View File

@@ -40,10 +40,10 @@
BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
(const BRepSweep_Builder& aBuilder,
const TopoDS_Shape& aGenShape,
const Sweep_NumShape& aDirShape):
const TopoDS_Shape& aGenShape,
const Sweep_NumShape& aDirShape):
myBuilder(aBuilder),
myBuilder(aBuilder),
myGenShape(aGenShape),
myDirWire(aDirShape),
@@ -55,9 +55,9 @@ BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
// *****************************************************************
myShapes(1,myGenShapeTool.NbShapes(),
1,myDirShapeTool.NbShapes()),
1,myDirShapeTool.NbShapes()),
myBuiltShapes(1,myGenShapeTool.NbShapes(),
1,myDirShapeTool.NbShapes())
1,myDirShapeTool.NbShapes())
{
myBuiltShapes.Init(Standard_False);
}
@@ -94,7 +94,7 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape ()
TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS)
{
if (myGenShapeTool.Index(aGenS) != 0 &&
HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire);
HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire);
else {
TopoDS_Shape bidon;
return bidon;
@@ -108,7 +108,7 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS)
//=======================================================================
TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
const Sweep_NumShape& aDirS)
const Sweep_NumShape& aDirS)
{
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
Standard_Integer iDirS = myDirShapeTool.Index(aDirS);
@@ -125,80 +125,80 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
switch (aGenSType){
case TopAbs_VERTEX :
myShapes(iGenS,iDirS)=MakeEmptyVertex(aGenS,aDirS);
break;
myShapes(iGenS,iDirS)=MakeEmptyVertex(aGenS,aDirS);
break;
case TopAbs_EDGE :
myShapes(iGenS,iDirS)=MakeEmptyGeneratingEdge(aGenS,aDirS);
break;
myShapes(iGenS,iDirS)=MakeEmptyGeneratingEdge(aGenS,aDirS);
break;
case TopAbs_WIRE :
myBuilder.MakeWire(myShapes(iGenS,iDirS));
break;
myBuilder.MakeWire(myShapes(iGenS,iDirS));
break;
case TopAbs_FACE :
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
break;
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
break;
case TopAbs_SHELL :
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
Standard_NoSuchObject::Raise("Unknown Shape");
break;
Standard_NoSuchObject::Raise("Unknown Shape");
break;
}
bGenS = aGenS;
myGenShapeTool.SetOrientation(bGenS,TopAbs_FORWARD);
for (It.Init(bGenS);It.More();It.Next()){
subGenS = It.Value();
Or = It.Orientation();
if(HasShape(subGenS,aDirS)){
newShape = Shape(subGenS,aDirS);
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
//Les "planchers" doivent etre construits par les
//fonctions de construcion geometrique identiquement
//au shape generateur.
//On leur recolle juste une orientation pour etre bien
//sur.
subGenS = It.Value();
Or = It.Orientation();
if(HasShape(subGenS,aDirS)){
newShape = Shape(subGenS,aDirS);
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
//Les "planchers" doivent etre construits par les
//fonctions de construcion geometrique identiquement
//au shape generateur.
//On leur recolle juste une orientation pour etre bien
//sur.
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
if (aGenSType==TopAbs_FACE){
if(subGenSType==TopAbs_VERTEX){
SetParameters(myShapes(iGenS,iDirS),
newShape,aGenS,subGenS,aDirS);
}
else if(subGenSType==TopAbs_EDGE){
SetPCurve(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS,Or);
}
else if(subGenSType==TopAbs_WIRE){
BRepSweep_Iterator Jt;
cGenS = subGenS;
myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD);
for (Jt.Init(cGenS);Jt.More();Jt.Next()){
subsubGenS = Jt.Value();
Pr = Jt.Orientation();
if(HasShape(subsubGenS,aDirS)){
TopoDS_Shape newsubEdge = Shape(subsubGenS,aDirS);
SetPCurve(myShapes(iGenS,iDirS),newsubEdge,
aGenS,subsubGenS,aDirS,Pr);
}
}
}
}
else if(aGenSType==TopAbs_EDGE){
SetGeneratingParameter(myShapes(iGenS,iDirS),
newShape,bGenS,subGenS,aDirS);
}
}
}
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
if (aGenSType==TopAbs_FACE){
if(subGenSType==TopAbs_VERTEX){
SetParameters(myShapes(iGenS,iDirS),
newShape,aGenS,subGenS,aDirS);
}
else if(subGenSType==TopAbs_EDGE){
SetPCurve(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS,Or);
}
else if(subGenSType==TopAbs_WIRE){
BRepSweep_Iterator Jt;
cGenS = subGenS;
myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD);
for (Jt.Init(cGenS);Jt.More();Jt.Next()){
subsubGenS = Jt.Value();
Pr = Jt.Orientation();
if(HasShape(subsubGenS,aDirS)){
TopoDS_Shape newsubEdge = Shape(subsubGenS,aDirS);
SetPCurve(myShapes(iGenS,iDirS),newsubEdge,
aGenS,subsubGenS,aDirS,Pr);
}
}
}
}
else if(aGenSType==TopAbs_EDGE){
SetGeneratingParameter(myShapes(iGenS,iDirS),
newShape,bGenS,subGenS,aDirS);
}
}
}
}
}
else if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){
@@ -209,201 +209,201 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS,
Standard_Boolean sepwires = Standard_False;
switch (aGenSType){
case TopAbs_VERTEX :
myShapes(iGenS,iDirS)=MakeEmptyDirectingEdge(aGenS,aDirS);
break;
myShapes(iGenS,iDirS)=MakeEmptyDirectingEdge(aGenS,aDirS);
break;
case TopAbs_EDGE :
//On cree un wire intermediaire qui contient tous les edges
//du montant (face) du Shape pour le cas standard, et une
//sequence de wires pour les cas merdiques necessitant des
//wires independants.
myBuilder.MakeWire(newWire);
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
break;
//On cree un wire intermediaire qui contient tous les edges
//du montant (face) du Shape pour le cas standard, et une
//sequence de wires pour les cas merdiques necessitant des
//wires independants.
myBuilder.MakeWire(newWire);
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
break;
case TopAbs_WIRE :
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
case TopAbs_FACE :
//On cree un shell intermediaire dans lequel on jette toutes
//les faces en direct, pour eviter les empilages compliques
//de shells et sous shells dans la structure du solide.
myBuilder.MakeShell(newShell);
myBuilder.MakeSolid(myShapes(iGenS,iDirS));
break;
//On cree un shell intermediaire dans lequel on jette toutes
//les faces en direct, pour eviter les empilages compliques
//de shells et sous shells dans la structure du solide.
myBuilder.MakeShell(newShell);
myBuilder.MakeSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SHELL :
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
Standard_NoSuchObject::Raise("Unknown Shape");
break;
Standard_NoSuchObject::Raise("Unknown Shape");
break;
}
bGenS = aGenS;
myGenShapeTool.SetOrientation(bGenS,TopAbs_FORWARD);
for (It.Init(bGenS);It.More();It.Next()){
subGenS = It.Value();
if(HasShape(subGenS,aDirS)){
newShape = Shape(subGenS,aDirS);
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
if (aGenSType==TopAbs_EDGE){
Or = It.Orientation();
if (SeparatedWires(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
sepwires = Standard_True;
TopoDS_Shape wi;
myBuilder.MakeWire(wi);
myBuilder.Add(wi,newShape,Or);
wi.Closed(BRep_Tool::IsClosed(wi));
WireSeq.Append(wi);
}
else{
myBuilder.Add(newWire,newShape,Or);
}
SetDirectingPCurve (myShapes(iGenS,iDirS),
newShape,bGenS,subGenS,aDirS,Or);
}
else if (aGenSType==TopAbs_WIRE){
Or = It.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else if (aGenSType==TopAbs_FACE){
Or = It.Orientation();
if(subGenSType == TopAbs_WIRE) {
for (Lt.Init(newShape);Lt.More();Lt.Next()){
myBuilder.Add(newShell,Lt.Value(),
TopAbs::Compose(Lt.Orientation(),Or));
}
}
else if(subGenSType == TopAbs_EDGE) {
myBuilder.Add(newShell,newShape,Or);
}
}
else if(aGenSType == TopAbs_SHELL){
Or = TopAbs_FORWARD;
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else if(aGenSType == TopAbs_COMPOUND){
Or = TopAbs_FORWARD;
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else{
Or = It.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
}
}
subGenS = It.Value();
if(HasShape(subGenS,aDirS)){
newShape = Shape(subGenS,aDirS);
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
if (aGenSType==TopAbs_EDGE){
Or = It.Orientation();
if (SeparatedWires(myShapes(iGenS,iDirS),newShape,
aGenS,subGenS,aDirS)){
sepwires = Standard_True;
TopoDS_Shape wi;
myBuilder.MakeWire(wi);
myBuilder.Add(wi,newShape,Or);
wi.Closed(BRep_Tool::IsClosed(wi));
WireSeq.Append(wi);
}
else{
myBuilder.Add(newWire,newShape,Or);
}
SetDirectingPCurve (myShapes(iGenS,iDirS),
newShape,bGenS,subGenS,aDirS,Or);
}
else if (aGenSType==TopAbs_WIRE){
Or = It.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else if (aGenSType==TopAbs_FACE){
Or = It.Orientation();
if(subGenSType == TopAbs_WIRE) {
for (Lt.Init(newShape);Lt.More();Lt.Next()){
myBuilder.Add(newShell,Lt.Value(),
TopAbs::Compose(Lt.Orientation(),Or));
}
}
else if(subGenSType == TopAbs_EDGE) {
myBuilder.Add(newShell,newShape,Or);
}
}
else if(aGenSType == TopAbs_SHELL){
Or = TopAbs_FORWARD;
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else if(aGenSType == TopAbs_COMPOUND){
Or = TopAbs_FORWARD;
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
else{
Or = It.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
}
}
}
bDirS = aDirS;
for (Kt.Init(bDirS);Kt.More();Kt.Next()){
subDirS = Kt.Value();
if(HasShape(aGenS,subDirS)){
newShape = Shape(aGenS,subDirS);
if (GDDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,aDirS,subDirS)){
if (aGenSType==TopAbs_EDGE){
Or = TopAbs::Reverse(Kt.Orientation());
myBuilder.Add(newWire,newShape,Or);
SetGeneratingPCurve
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS,Or);
}
else if(aGenSType==TopAbs_VERTEX){
Or = Kt.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
SetDirectingParameter
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS);
}
else if(aGenSType==TopAbs_FACE){
Or = Kt.Orientation();
myBuilder.Add(newShell,newShape,Or);
}
}
}
subDirS = Kt.Value();
if(HasShape(aGenS,subDirS)){
newShape = Shape(aGenS,subDirS);
if (GDDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
aGenS,aDirS,subDirS)){
if (aGenSType==TopAbs_EDGE){
Or = TopAbs::Reverse(Kt.Orientation());
myBuilder.Add(newWire,newShape,Or);
SetGeneratingPCurve
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS,Or);
}
else if(aGenSType==TopAbs_VERTEX){
Or = Kt.Orientation();
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
SetDirectingParameter
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS);
}
else if(aGenSType==TopAbs_FACE){
Or = Kt.Orientation();
myBuilder.Add(newShell,newShape,Or);
}
}
}
}
if (aGenSType==TopAbs_EDGE){
if (sepwires){
for(Standard_Integer ij = 1;ij <= WireSeq.Length();ij++){
myBuilder.Add(myShapes(iGenS,iDirS),WireSeq.Value(ij));
}
}
else{
newWire.Closed(BRep_Tool::IsClosed(newWire));
myBuilder.Add(myShapes(iGenS,iDirS),newWire);
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
SetContinuity(aGenS,aDirS);
if (sepwires){
for(Standard_Integer ij = 1;ij <= WireSeq.Length();ij++){
myBuilder.Add(myShapes(iGenS,iDirS),WireSeq.Value(ij));
}
}
else{
newWire.Closed(BRep_Tool::IsClosed(newWire));
myBuilder.Add(myShapes(iGenS,iDirS),newWire);
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
SetContinuity(aGenS,aDirS);
}
if (aGenSType==TopAbs_WIRE){
SetContinuity(aGenS,aDirS);
SetContinuity(aGenS,aDirS);
}
if (aGenSType==TopAbs_FACE){
newShell.Closed (BRep_Tool::IsClosed (newShell));
TopoDS_Shape temp = SplitShell(newShell);
TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
Lt.Init(temp);
if(Lt.More()) Lt.Next();
if(Lt.More()){
for (Lt.Init(temp);Lt.More();Lt.Next()){
myBuilder.Add(myShapes(iGenS,iDirS),Lt.Value(),Or);
}
}
else myBuilder.Add(myShapes(iGenS,iDirS),newShell,Or);
TopoDS_Shape temp = SplitShell(newShell);
TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
Lt.Init(temp);
if(Lt.More()) Lt.Next();
if(Lt.More()){
for (Lt.Init(temp);Lt.More();Lt.Next()){
myBuilder.Add(myShapes(iGenS,iDirS),Lt.Value(),Or);
}
}
else myBuilder.Add(myShapes(iGenS,iDirS),newShell,Or);
}
}
else if (myDirShapeTool.Type(aDirS)==TopAbs_WIRE){
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
switch (aGenSType){
case TopAbs_VERTEX :
myBuilder.MakeWire(myShapes(iGenS,iDirS));
break;
myBuilder.MakeWire(myShapes(iGenS,iDirS));
break;
case TopAbs_EDGE :
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
case TopAbs_WIRE :
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
case TopAbs_FACE :
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SHELL :
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
Standard_NoSuchObject::Raise("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
Standard_NoSuchObject::Raise("Unknown Shape");
break;
Standard_NoSuchObject::Raise("Unknown Shape");
break;
}
bDirS = aDirS;
for (Kt.Init(aDirS);Kt.More();Kt.Next()){
subDirS = Kt.Value();
if(HasShape(aGenS,subDirS)){
Or = Kt.Orientation();
newShape = Shape(aGenS,subDirS);
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
subDirS = Kt.Value();
if(HasShape(aGenS,subDirS)){
Or = Kt.Orientation();
newShape = Shape(aGenS,subDirS);
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
}
}
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
}
// Change the "Closed" flag only for Wires and Shells
if (myShapes(iGenS, iDirS).ShapeType() == TopAbs_WIRE ||
myShapes(iGenS, iDirS).ShapeType() == TopAbs_SHELL)
myShapes(iGenS, iDirS).ShapeType() == TopAbs_SHELL)
myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
return myShapes(iGenS,iDirS);
}

View File

@@ -61,6 +61,8 @@
#include <GeomAdaptor_HCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <TopExp_Explorer.hxx>
static Standard_Real ComputeTolerance(TopoDS_Edge& E,
const TopoDS_Face& F,
const Handle(Geom2d_Curve)& C)
@@ -216,14 +218,26 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyGeneratingEdge
const Sweep_NumShape& aDirV)
{
//call in case of construction with copy, or only when meridian touches myaxe.
Standard_Real First,Last;
TopLoc_Location Loc;
Handle(Geom_Curve) C = Handle(Geom_Curve)::DownCast
(BRep_Tool::Curve(TopoDS::Edge(aGenE),Loc,First,Last)->Copy());
C->Transform(Loc.Transformation());
TopoDS_Edge E;
if(aDirV.Index() == 2) C->Transform(myLocation.Transformation());
myBuilder.Builder().MakeEdge(E,C,BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
TopoDS_Edge E;
if(BRep_Tool::Degenerated(TopoDS::Edge(aGenE)))
{
myBuilder.Builder().MakeEdge(E);
myBuilder.Builder().UpdateEdge(E, BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
myBuilder.Builder().Degenerated(E, Standard_True);
}
else
{
Standard_Real First,Last;
TopLoc_Location Loc;
Handle(Geom_Curve) C = Handle(Geom_Curve)::DownCast
(BRep_Tool::Curve(TopoDS::Edge(aGenE),Loc,First,Last)->Copy());
if(!C.IsNull())
{
C->Transform(Loc.Transformation());
if(aDirV.Index() == 2) C->Transform(myLocation.Transformation());
}
myBuilder.Builder().MakeEdge(E,C,BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
}
if (aDirV.Index() == 1 &&
IsInvariant(aGenE) &&
myDirShapeTool.NbShapes() == 3) {
@@ -718,6 +732,7 @@ Standard_Boolean BRepSweep_Rotation::GGDShapeIsToAdd
const TopoDS_Shape& aSubGenS,
const Sweep_NumShape& aDirS )const
{
Standard_Boolean aRes = Standard_True;
if (aNewShape.ShapeType()==TopAbs_FACE &&
aNewSubShape.ShapeType()==TopAbs_EDGE &&
aGenS.ShapeType()==TopAbs_EDGE &&
@@ -729,11 +744,11 @@ Standard_Boolean BRepSweep_Rotation::GGDShapeIsToAdd
return (!IsInvariant(aSubGenS));
}
else{
return Standard_True;
return aRes;
}
}
else{
return Standard_True;
return aRes;
}
}
@@ -830,20 +845,33 @@ Standard_Boolean BRepSweep_Rotation::HasShape
const Sweep_NumShape& aDirS)const
{
if(aDirS.Type()==TopAbs_EDGE&&
aGenS.ShapeType()==TopAbs_EDGE){
aGenS.ShapeType()==TopAbs_EDGE)
{
// Verify that the edge has entrails
const TopoDS_Edge& anEdge = TopoDS::Edge(aGenS);
Standard_Boolean hasGeom = !BRep_Tool::Degenerated(anEdge);
if (hasGeom)
{ // The edge is not degenerated. Check if it has no curve
Standard_Real aPFirst, aPLast;
TopLoc_Location aLoc;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aLoc, aPFirst, aPLast);
hasGeom = !aCurve.IsNull();
//
if(BRep_Tool::Degenerated(anEdge)) return Standard_False;
Standard_Real aPFirst, aPLast;
TopLoc_Location aLoc;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aLoc, aPFirst, aPLast);
if(aCurve.IsNull()) return Standard_False;
if(IsInvariant(aGenS)) return Standard_False;
//Check seem edge
TopExp_Explorer FaceExp(myGenShape, TopAbs_FACE);
for (;FaceExp.More(); FaceExp.Next()) {
TopoDS_Face F = TopoDS::Face(FaceExp.Current());
if (BRepTools::IsReallyClosed(anEdge, F))
return Standard_False;
}
return hasGeom && !IsInvariant(aGenS);
return Standard_True;
}
else{
else
{
return Standard_True;
}
}

View File

@@ -148,15 +148,27 @@ TopoDS_Shape BRepSweep_Translation::MakeEmptyGeneratingEdge
//Call only in case of construction with copy.
Standard_ConstructionError_Raise_if
(!myCopy,"BRepSweep_Translation::MakeEmptyVertex");
TopLoc_Location L;
Standard_Real First,Last;
Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(aGenE),L,First,Last);
C = Handle(Geom_Curve)::DownCast(C->Copy());
C->Transform(L.Transformation());
if (aDirV.Index() == 2) C->Transform(myLocation.Transformation());
TopoDS_Edge newE;
myBuilder.Builder().MakeEdge
(newE,C,BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
if(BRep_Tool::Degenerated(TopoDS::Edge(aGenE)))
{
myBuilder.Builder().MakeEdge(newE);
myBuilder.Builder().UpdateEdge(newE, BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
myBuilder.Builder().Degenerated(newE, Standard_True);
}
else
{
TopLoc_Location L;
Standard_Real First,Last;
Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(aGenE),L,First,Last);
if(!C.IsNull())
{
C = Handle(Geom_Curve)::DownCast(C->Copy());
C->Transform(L.Transformation());
if (aDirV.Index() == 2) C->Transform(myLocation.Transformation());
}
myBuilder.Builder().MakeEdge
(newE,C,BRep_Tool::Tolerance(TopoDS::Edge(aGenE)));
}
return newE;
}
@@ -296,12 +308,23 @@ void BRepSweep_Translation::SetPCurve
{
//Set on edges of cap faces the same pcurves as
//edges of the generating face.
Standard_Real First,Last;
myBuilder.Builder().UpdateEdge
(TopoDS::Edge(aNewEdge),
BRep_Tool::CurveOnSurface
(TopoDS::Edge(aGenE),TopoDS::Face(aGenF),First,Last),
TopoDS::Face(aNewFace),Precision::PConfusion());
Standard_Boolean isclosed = BRep_Tool::IsClosed(TopoDS::Edge(aGenE), TopoDS::Face(aGenF));
if(isclosed)
{
Standard_Real First, Last;
TopoDS_Edge anE = TopoDS::Edge(aGenE.Oriented(TopAbs_FORWARD));
Handle(Geom2d_Curve) aC1 = BRep_Tool::CurveOnSurface(anE, TopoDS::Face(aGenF), First, Last);
anE.Reverse();
Handle(Geom2d_Curve) aC2 = BRep_Tool::CurveOnSurface(anE, TopoDS::Face(aGenF), First, Last);
myBuilder.Builder().UpdateEdge(TopoDS::Edge(aNewEdge), aC1, aC2, TopoDS::Face(aNewFace),Precision::PConfusion());
}
else
{
Standard_Real First,Last;
myBuilder.Builder().UpdateEdge(TopoDS::Edge(aNewEdge),
BRep_Tool::CurveOnSurface(TopoDS::Edge(aGenE),TopoDS::Face(aGenF),First,Last),
TopoDS::Face(aNewFace),Precision::PConfusion());
}
}

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