Open CASCADE Technology  7.1.0.beta
Public Member Functions

BRepExtrema_ShapeProximity Class Reference

Tool class for shape proximity detection. For two given shapes and given tolerance (offset from the mesh) the algorithm allows to determine whether or not they are overlapped. The algorithm input consists of any shapes which can be decomposed into individual faces (used as basic shape elements). High performance is achieved through the use of existing triangulation of faces. So poly triangulation (with the desired deflection) should already be built. Note that solution is approximate (and corresponds to the deflection used for triangulation). More...

#include <BRepExtrema_ShapeProximity.hxx>

Public Member Functions

 BRepExtrema_ShapeProximity (const Standard_Real theTolerance=0.0)
 Creates empty proximity tool. More...
 
 BRepExtrema_ShapeProximity (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, const Standard_Real theTolerance=0.0)
 Creates proximity tool for the given two shapes. More...
 
Standard_Real Tolerance () const
 Returns tolerance value for overlap test (distance between shapes). More...
 
void SetTolerance (const Standard_Real theTolerance)
 Sets tolerance value for overlap test (distance between shapes). More...
 
Standard_Boolean LoadShape1 (const TopoDS_Shape &theShape1)
 Loads 1st shape into proximity tool. More...
 
Standard_Boolean LoadShape2 (const TopoDS_Shape &theShape2)
 Loads 2nd shape into proximity tool. More...
 
void Perform ()
 Performs search of overlapped faces. More...
 
Standard_Boolean IsDone () const
 True if the search is completed. More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes1 () const
 Returns set of IDs of overlapped faces of 1st shape (started from 0). More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes2 () const
 Returns set of IDs of overlapped faces of 2nd shape (started from 0). More...
 
const TopoDS_FaceGetSubShape1 (const Standard_Integer theID) const
 Returns sub-shape from 1st shape with the given index (started from 0). More...
 
const TopoDS_FaceGetSubShape2 (const Standard_Integer theID) const
 Returns sub-shape from 1st shape with the given index (started from 0). More...
 
const Handle< BRepExtrema_TriangleSet > & ElementSet1 () const
 Returns set of all the face triangles of the 1st shape. More...
 
const Handle< BRepExtrema_TriangleSet > & ElementSet2 () const
 Returns set of all the face triangles of the 2nd shape. More...
 

Detailed Description

Tool class for shape proximity detection. For two given shapes and given tolerance (offset from the mesh) the algorithm allows to determine whether or not they are overlapped. The algorithm input consists of any shapes which can be decomposed into individual faces (used as basic shape elements). High performance is achieved through the use of existing triangulation of faces. So poly triangulation (with the desired deflection) should already be built. Note that solution is approximate (and corresponds to the deflection used for triangulation).

The algorithm can be run in two modes. If tolerance is set to zero, the algorithm will detect only intersecting faces (containing triangles with common points). If tolerance is set to positive value, the algorithm will also detect faces located on distance less than the given tolerance from each other.

Constructor & Destructor Documentation

BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity ( const Standard_Real  theTolerance = 0.0)

Creates empty proximity tool.

BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity ( const TopoDS_Shape theShape1,
const TopoDS_Shape theShape2,
const Standard_Real  theTolerance = 0.0 
)

Creates proximity tool for the given two shapes.

Member Function Documentation

const Handle< BRepExtrema_TriangleSet >& BRepExtrema_ShapeProximity::ElementSet1 ( ) const
inline

Returns set of all the face triangles of the 1st shape.

const Handle< BRepExtrema_TriangleSet >& BRepExtrema_ShapeProximity::ElementSet2 ( ) const
inline

Returns set of all the face triangles of the 2nd shape.

const TopoDS_Face& BRepExtrema_ShapeProximity::GetSubShape1 ( const Standard_Integer  theID) const
inline

Returns sub-shape from 1st shape with the given index (started from 0).

const TopoDS_Face& BRepExtrema_ShapeProximity::GetSubShape2 ( const Standard_Integer  theID) const
inline

Returns sub-shape from 1st shape with the given index (started from 0).

Standard_Boolean BRepExtrema_ShapeProximity::IsDone ( ) const
inline

True if the search is completed.

Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 ( const TopoDS_Shape theShape1)

Loads 1st shape into proximity tool.

Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 ( const TopoDS_Shape theShape2)

Loads 2nd shape into proximity tool.

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_ShapeProximity::OverlapSubShapes1 ( ) const
inline

Returns set of IDs of overlapped faces of 1st shape (started from 0).

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_ShapeProximity::OverlapSubShapes2 ( ) const
inline

Returns set of IDs of overlapped faces of 2nd shape (started from 0).

void BRepExtrema_ShapeProximity::Perform ( )

Performs search of overlapped faces.

void BRepExtrema_ShapeProximity::SetTolerance ( const Standard_Real  theTolerance)
inline

Sets tolerance value for overlap test (distance between shapes).

Standard_Real BRepExtrema_ShapeProximity::Tolerance ( ) const
inline

Returns tolerance value for overlap test (distance between shapes).


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