Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions
BRepExtrema_ProximityDistTool Class Reference

Tool class for computation the proximity distance from first primitive set to second one that is the maximal from minimum perpendicular distances. If no perpendicular distance is found, the minimum distance will be returned. This tool is not intended to be used independently, and is integrated in other classes, implementing algorithms based on shape tessellation (BRepExtrema_ProximityValueTool). More...

#include <BRepExtrema_ProximityDistTool.hxx>

Inheritance diagram for BRepExtrema_ProximityDistTool:
Inheritance graph
[legend]

Data Structures

struct  PrjState
 Struct with information about projection point state from 2nd BVH, providing proximity point of 2nd shape. More...
 

Public Types

enum  ProxPnt_Status { ProxPnt_Status_BORDER , ProxPnt_Status_MIDDLE , ProxPnt_Status_UNKNOWN }
 
typedef BVH_Tools< double, 3 >::BVH_PrjStateInTriangle BVH_PrjState
 
- Public Types inherited from BVH_Traverse< NumType, Dimension, BVHSetType, MetricType >
typedef BVH_Box< NumType, Dimension >::BVH_VecNt BVH_VecNt
 

Public Member Functions

 BRepExtrema_ProximityDistTool ()
 Creates new uninitialized tool.
 
 BRepExtrema_ProximityDistTool (const occ::handle< BRepExtrema_TriangleSet > &theSet1, const int theNbSamples1, const BVH_Array3d &theAddVertices1, const NCollection_DynamicArray< ProxPnt_Status > &theAddStatus1, const occ::handle< BRepExtrema_TriangleSet > &theSet2, const NCollection_DynamicArray< TopoDS_Shape > &theShapeList1, const NCollection_DynamicArray< TopoDS_Shape > &theShapeList2)
 Creates new tool for the given element sets.
 
void LoadTriangleSets (const occ::handle< BRepExtrema_TriangleSet > &theSet1, const occ::handle< BRepExtrema_TriangleSet > &theSet2)
 Loads the given element sets into the tool.
 
void LoadShapeLists (const NCollection_DynamicArray< TopoDS_Shape > &theShapeList1, const NCollection_DynamicArray< TopoDS_Shape > &theShapeList2)
 Loads the given list of subshapes into the tool.
 
void LoadAdditionalPointsFirstSet (const BVH_Array3d &theAddVertices1, const NCollection_DynamicArray< ProxPnt_Status > &theAddStatus1)
 Loads given additional vertices and their statuses.
 
void Perform ()
 Performs searching of the proximity distance.
 
- Public Member Functions inherited from BVH_Distance< double, 3, BVH_Vec3d, BRepExtrema_TriangleSet >
 BVH_Distance ()
 
void SetObject (const BVH_Vec3d &theObject)
 
double ComputeDistance ()
 
bool IsDone () const
 Returns the computed distance.
 
double Distance () const
 Returns the computed distance.
 
bool IsMetricBetter (const double &theLeft, const double &theRight) const override
 Rejects the branch by the metric.
 
bool RejectMetric (const double &theMetric) const override
 Rejects the branch by the metric.
 
bool Stop () const override
 Returns the flag controlling the tree descend.
 
- Public Member Functions inherited from BVH_Traverse< NumType, Dimension, BVHSetType, MetricType >
 BVH_Traverse ()
 
void SetBVHSet (BVHSetType *theBVHSet)
 
virtual bool AcceptMetric (const MetricType &) const
 Rejection of the node by bounding box. Metric is computed to choose the best branch. Returns true if the node should be rejected, false otherwise.
 
virtual bool RejectNode (const BVH_VecNt &theCornerMin, const BVH_VecNt &theCornerMax, MetricType &theMetric) const =0
 Rejection of the node by bounding box. Metric is computed to choose the best branch. Returns true if the node should be rejected, false otherwise.
 
virtual bool Accept (const int theIndex, const MetricType &theMetric)=0
 Leaf element acceptance. Metric of the parent leaf-node is passed to avoid the check on the element and accept it unconditionally. Returns true if the element has been accepted, false otherwise.
 
int Select ()
 Performs selection of the elements from the BVH tree by the rules defined in Accept/Reject methods. Returns the number of accepted elements.
 
int Select (const opencascade::handle< BVH_Tree< NumType, Dimension > > &theBVH)
 Performs selection of the elements from the BVH tree by the rules defined in Accept/Reject methods. Returns the number of accepted elements.
 
- Public Member Functions inherited from BVH_BaseTraverse< MetricType >
virtual bool IsMetricBetter (const MetricType &, const MetricType &) const
 
virtual bool RejectMetric (const MetricType &) const
 

Reject/Accept implementations

Defines the rules for node rejection by bounding box.

double myMinDistance
 Minimal distance from point to BVH, could be not equal to myDistance.
 
BVH_Vec3d myMinDistPoint
 Point on BVH providing the minimal distance.
 
BVH_Vec3d myExtremaPoint
 Point on BVH providing the extrema.
 
double myProxDist
 Proximity distance.
 
BVH_Vec3d myPnt1
 Proximity points.
 
BVH_Vec3d myPnt2
 Minimal distance from point to BVH, could be not equal to myDistance.
 
ProxPnt_Status myPntStatus1
 Proximity points' status.
 
ProxPnt_Status myPntStatus2
 Minimal distance from point to BVH, could be not equal to myDistance.
 
bool RejectNode (const BVH_Vec3d &theCornerMin, const BVH_Vec3d &theCornerMax, double &theMetric) const override
 Minimal distance from point to BVH, could be not equal to myDistance.
 
bool Accept (const int theSgmIdx, const double &) override
 Defines the rules for leaf acceptance.
 
void ProximityPoints (BVH_Vec3d &thePoint1, BVH_Vec3d &thePoint2) const
 Returns points on triangles sets, which provide the proximity distance.
 
void ProximityPointsStatus (ProxPnt_Status &thePointStatus1, ProxPnt_Status &thePointStatus2) const
 Returns status of points on triangles sets, which provide the proximity distance.
 
double ProximityDistance () const
 Returns the computed distance.
 
static bool IsNodeOnBorder (const int theNodeIdx, const occ::handle< Poly_Triangulation > &theTr)
 Returns true if the node is on the boarder.
 
static bool IsEdgeOnBorder (const int theTrgIdx, const int theFirstEdgeNodeIdx, const int theSecondEdgeNodeIdx, const occ::handle< Poly_Triangulation > &theTr)
 Returns true if the edge is on the boarder.
 
double ComputeDistance ()
 Computes the distance between object and BVH tree.
 
void DefineStatusProxPnt ()
 Defines the status of proximity points.
 

Additional Inherited Members

- Protected Member Functions inherited from BVH_BaseTraverse< MetricType >
 BVH_BaseTraverse ()
 Destructor.
 
virtual ~BVH_BaseTraverse ()=default
 Destructor.
 
- Protected Attributes inherited from BVH_Distance< double, 3, BVH_Vec3d, BRepExtrema_TriangleSet >
double myDistance
 Distance.
 
bool myIsDone
 State of the algorithm.
 
BVH_Vec3d myObject
 Object to compute the distance to.
 
- Protected Attributes inherited from BVH_Traverse< NumType, Dimension, BVHSetType, MetricType >
BVHSetTypemyBVHSet
 

Detailed Description

Tool class for computation the proximity distance from first primitive set to second one that is the maximal from minimum perpendicular distances. If no perpendicular distance is found, the minimum distance will be returned. This tool is not intended to be used independently, and is integrated in other classes, implementing algorithms based on shape tessellation (BRepExtrema_ProximityValueTool).

Please note that algorithm results are approximate and depend greatly on the quality of input tessellation(s).

Member Typedef Documentation

◆ BVH_PrjState

Member Enumeration Documentation

◆ ProxPnt_Status

Enumerator
ProxPnt_Status_BORDER 
ProxPnt_Status_MIDDLE 
ProxPnt_Status_UNKNOWN 

Constructor & Destructor Documentation

◆ BRepExtrema_ProximityDistTool() [1/2]

BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool ( )

Creates new uninitialized tool.

◆ BRepExtrema_ProximityDistTool() [2/2]

BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool ( const occ::handle< BRepExtrema_TriangleSet > & theSet1,
const int theNbSamples1,
const BVH_Array3d & theAddVertices1,
const NCollection_DynamicArray< ProxPnt_Status > & theAddStatus1,
const occ::handle< BRepExtrema_TriangleSet > & theSet2,
const NCollection_DynamicArray< TopoDS_Shape > & theShapeList1,
const NCollection_DynamicArray< TopoDS_Shape > & theShapeList2 )

Creates new tool for the given element sets.

Member Function Documentation

◆ Accept()

bool BRepExtrema_ProximityDistTool::Accept ( const int theSgmIdx,
const double &  )
override

Defines the rules for leaf acceptance.

◆ ComputeDistance()

double BRepExtrema_ProximityDistTool::ComputeDistance ( )
protected

Computes the distance between object and BVH tree.

◆ DefineStatusProxPnt()

void BRepExtrema_ProximityDistTool::DefineStatusProxPnt ( )
protected

Defines the status of proximity points.

◆ IsEdgeOnBorder()

static bool BRepExtrema_ProximityDistTool::IsEdgeOnBorder ( const int theTrgIdx,
const int theFirstEdgeNodeIdx,
const int theSecondEdgeNodeIdx,
const occ::handle< Poly_Triangulation > & theTr )
static

Returns true if the edge is on the boarder.

◆ IsNodeOnBorder()

static bool BRepExtrema_ProximityDistTool::IsNodeOnBorder ( const int theNodeIdx,
const occ::handle< Poly_Triangulation > & theTr )
static

Returns true if the node is on the boarder.

◆ LoadAdditionalPointsFirstSet()

void BRepExtrema_ProximityDistTool::LoadAdditionalPointsFirstSet ( const BVH_Array3d & theAddVertices1,
const NCollection_DynamicArray< ProxPnt_Status > & theAddStatus1 )

Loads given additional vertices and their statuses.

◆ LoadShapeLists()

void BRepExtrema_ProximityDistTool::LoadShapeLists ( const NCollection_DynamicArray< TopoDS_Shape > & theShapeList1,
const NCollection_DynamicArray< TopoDS_Shape > & theShapeList2 )

Loads the given list of subshapes into the tool.

◆ LoadTriangleSets()

void BRepExtrema_ProximityDistTool::LoadTriangleSets ( const occ::handle< BRepExtrema_TriangleSet > & theSet1,
const occ::handle< BRepExtrema_TriangleSet > & theSet2 )

Loads the given element sets into the tool.

◆ Perform()

void BRepExtrema_ProximityDistTool::Perform ( )

Performs searching of the proximity distance.

◆ ProximityDistance()

double BRepExtrema_ProximityDistTool::ProximityDistance ( ) const
inline

Returns the computed distance.

◆ ProximityPoints()

void BRepExtrema_ProximityDistTool::ProximityPoints ( BVH_Vec3d & thePoint1,
BVH_Vec3d & thePoint2 ) const
inline

Returns points on triangles sets, which provide the proximity distance.

◆ ProximityPointsStatus()

void BRepExtrema_ProximityDistTool::ProximityPointsStatus ( ProxPnt_Status & thePointStatus1,
ProxPnt_Status & thePointStatus2 ) const
inline

Returns status of points on triangles sets, which provide the proximity distance.

◆ RejectNode()

bool BRepExtrema_ProximityDistTool::RejectNode ( const BVH_Vec3d & theCornerMin,
const BVH_Vec3d & theCornerMax,
double & theMetric ) const
override

Minimal distance from point to BVH, could be not equal to myDistance.

Field Documentation

◆ myExtremaPoint

BVH_Vec3d BRepExtrema_ProximityDistTool::myExtremaPoint
protected

Point on BVH providing the extrema.

◆ myMinDistance

double BRepExtrema_ProximityDistTool::myMinDistance
protected

Minimal distance from point to BVH, could be not equal to myDistance.

◆ myMinDistPoint

BVH_Vec3d BRepExtrema_ProximityDistTool::myMinDistPoint
protected

Point on BVH providing the minimal distance.

◆ myPnt1

BVH_Vec3d BRepExtrema_ProximityDistTool::myPnt1
protected

Proximity points.

◆ myPnt2

BVH_Vec3d BRepExtrema_ProximityDistTool::myPnt2
protected

Minimal distance from point to BVH, could be not equal to myDistance.

◆ myPntStatus1

ProxPnt_Status BRepExtrema_ProximityDistTool::myPntStatus1
protected

Proximity points' status.

◆ myPntStatus2

ProxPnt_Status BRepExtrema_ProximityDistTool::myPntStatus2
protected

Minimal distance from point to BVH, could be not equal to myDistance.

◆ myProxDist

double BRepExtrema_ProximityDistTool::myProxDist
protected

Proximity distance.


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