Open CASCADE Technology  7.6.0
Public Member Functions

BRepExtrema_OverlapTool Class Reference

Enables storing of individual overlapped triangles (useful for debug). More...

#include <BRepExtrema_OverlapTool.hxx>

Inheritance diagram for BRepExtrema_OverlapTool:
Inheritance graph
[legend]

Public Member Functions

 BRepExtrema_OverlapTool ()
 Creates new uninitialized overlap tool. More...
 
 BRepExtrema_OverlapTool (const Handle< BRepExtrema_TriangleSet > &theSet1, const Handle< BRepExtrema_TriangleSet > &theSet2)
 Creates new overlap tool for the given element sets. More...
 
void LoadTriangleSets (const Handle< BRepExtrema_TriangleSet > &theSet1, const Handle< BRepExtrema_TriangleSet > &theSet2)
 Loads the given element sets into the overlap tool. More...
 
void Perform (const Standard_Real theTolerance=0.0)
 Performs searching of overlapped mesh elements. More...
 
Standard_Boolean IsDone () const
 Is overlap test completed? More...
 
void MarkDirty ()
 Marks test results as outdated. More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes1 () const
 Returns set of overlapped sub-shapes of 1st shape (currently only faces are detected). More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes2 () const
 Returns set of overlapped sub-shapes of 2nd shape (currently only faces are detected). More...
 
void SetElementFilter (BRepExtrema_ElementFilter *theFilter)
 Sets filtering tool for preliminary checking pairs of mesh elements. More...
 
- Public Member Functions inherited from BVH_PairTraverse< Standard_Real, 3 >
 BVH_PairTraverse ()
 Constructor. More...
 
void SetBVHSets (void *theBVHSet1, void *theBVHSet2)
 Sets the BVH Sets containing the BVH trees. More...
 
virtual Standard_Boolean RejectNode (const BVH_VecNt &theCornerMin1, const BVH_VecNt &theCornerMax1, const BVH_VecNt &theCornerMin2, const BVH_VecNt &theCornerMax2, Standard_Real &theMetric) const=0
 Rejection of the pair of nodes by bounding boxes. Metric is computed to choose the best branch. Returns true if the pair of nodes should be rejected, false otherwise. More...
 
Standard_Integer Select ()
 Selection of the pairs of elements of two BVH trees by the rules defined in Accept/Reject methods. The method requires the BVHSets containing BVH trees to be set. Returns the number of accepted pairs of elements. More...
 
Standard_Integer Select (const opencascade::handle< BVH_Tree< Standard_Real, Dimension >> &theBVH1, const opencascade::handle< BVH_Tree< Standard_Real, Dimension >> &theBVH2)
 Performs selection of the elements from two BVH trees by the rules defined in Accept/Reject methods. Returns the number of accepted pairs of elements. More...
 
- Public Member Functions inherited from BVH_BaseTraverse< MetricType >
virtual Standard_Boolean IsMetricBetter (const MetricType &, const MetricType &) const
 Compares the two metrics and chooses the best one. Returns true if the first metric is better than the second, false otherwise. More...
 
virtual Standard_Boolean RejectMetric (const MetricType &) const
 Rejects the node by the metric. More...
 
virtual Standard_Boolean Stop () const
 Returns the flag controlling the tree descend. Returns true if the tree descend should be stopped. More...
 

Reject/Accept implementations

virtual Standard_Boolean RejectNode (const BVH_Vec3d &theCornerMin1, const BVH_Vec3d &theCornerMax1, const BVH_Vec3d &theCornerMin2, const BVH_Vec3d &theCornerMax2, Standard_Real &) const override
 Defines the rules for node rejection by bounding box. More...
 
virtual Standard_Boolean Accept (const Standard_Integer theLeaf1, const Standard_Integer theLeaf2) override
 Defines the rules for leaf acceptance. More...
 
void intersectTrianglesExact (const Standard_Integer theTrgIdx1, const Standard_Integer theTrgIdx2)
 Performs narrow-phase of overlap test (exact intersection). More...
 
void intersectTrianglesToler (const Standard_Integer theTrgIdx1, const Standard_Integer theTrgIdx2, const Standard_Real theToler)
 Performs narrow-phase of overlap test (intersection with non-zero tolerance). More...
 

Additional Inherited Members

- Public Types inherited from BVH_PairTraverse< Standard_Real, 3 >
typedef BVH_Box< Standard_Real, Dimension >::BVH_VecNt BVH_VecNt
 
- Protected Member Functions inherited from BVH_BaseTraverse< MetricType >
 BVH_BaseTraverse ()
 Constructor. More...
 
virtual ~BVH_BaseTraverse ()
 Destructor. More...
 
- Protected Attributes inherited from BVH_PairTraverse< Standard_Real, 3 >
void * myBVHSet1
 
void * myBVHSet2
 

Detailed Description

Enables storing of individual overlapped triangles (useful for debug).

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).

Constructor & Destructor Documentation

◆ BRepExtrema_OverlapTool() [1/2]

BRepExtrema_OverlapTool::BRepExtrema_OverlapTool ( )

Creates new uninitialized overlap tool.

◆ BRepExtrema_OverlapTool() [2/2]

BRepExtrema_OverlapTool::BRepExtrema_OverlapTool ( const Handle< BRepExtrema_TriangleSet > &  theSet1,
const Handle< BRepExtrema_TriangleSet > &  theSet2 
)

Creates new overlap tool for the given element sets.

Member Function Documentation

◆ Accept()

virtual Standard_Boolean BRepExtrema_OverlapTool::Accept ( const Standard_Integer  theLeaf1,
const Standard_Integer  theLeaf2 
)
overridevirtual

Defines the rules for leaf acceptance.

Implements BVH_PairTraverse< Standard_Real, 3 >.

◆ intersectTrianglesExact()

void BRepExtrema_OverlapTool::intersectTrianglesExact ( const Standard_Integer  theTrgIdx1,
const Standard_Integer  theTrgIdx2 
)
protected

Performs narrow-phase of overlap test (exact intersection).

◆ intersectTrianglesToler()

void BRepExtrema_OverlapTool::intersectTrianglesToler ( const Standard_Integer  theTrgIdx1,
const Standard_Integer  theTrgIdx2,
const Standard_Real  theToler 
)
protected

Performs narrow-phase of overlap test (intersection with non-zero tolerance).

◆ IsDone()

Standard_Boolean BRepExtrema_OverlapTool::IsDone ( ) const
inline

Is overlap test completed?

◆ LoadTriangleSets()

void BRepExtrema_OverlapTool::LoadTriangleSets ( const Handle< BRepExtrema_TriangleSet > &  theSet1,
const Handle< BRepExtrema_TriangleSet > &  theSet2 
)

Loads the given element sets into the overlap tool.

◆ MarkDirty()

void BRepExtrema_OverlapTool::MarkDirty ( )
inline

Marks test results as outdated.

◆ OverlapSubShapes1()

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_OverlapTool::OverlapSubShapes1 ( ) const
inline

Returns set of overlapped sub-shapes of 1st shape (currently only faces are detected).

◆ OverlapSubShapes2()

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_OverlapTool::OverlapSubShapes2 ( ) const
inline

Returns set of overlapped sub-shapes of 2nd shape (currently only faces are detected).

◆ Perform()

void BRepExtrema_OverlapTool::Perform ( const Standard_Real  theTolerance = 0.0)

Performs searching of overlapped mesh elements.

◆ RejectNode()

virtual Standard_Boolean BRepExtrema_OverlapTool::RejectNode ( const BVH_Vec3d theCornerMin1,
const BVH_Vec3d theCornerMax1,
const BVH_Vec3d theCornerMin2,
const BVH_Vec3d theCornerMax2,
Standard_Real  
) const
overridevirtual

Defines the rules for node rejection by bounding box.

◆ SetElementFilter()

void BRepExtrema_OverlapTool::SetElementFilter ( BRepExtrema_ElementFilter theFilter)
inline

Sets filtering tool for preliminary checking pairs of mesh elements.


The documentation for this class was generated from the following file: