Open CASCADE Technology 7.9.0
|
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>
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< Standard_Real, 3 >::BVH_PrjStateInTriangle | BVH_PrjState |
![]() | |
typedef BVH_Box< Standard_Real, Dimension >::BVH_VecNt | BVH_VecNt |
Public Member Functions | |
BRepExtrema_ProximityDistTool () | |
Creates new uninitialized tool. | |
BRepExtrema_ProximityDistTool (const Handle< BRepExtrema_TriangleSet > &theSet1, const Standard_Integer theNbSamples1, const BVH_Array3d &theAddVertices1, const NCollection_Vector< ProxPnt_Status > &theAddStatus1, const Handle< BRepExtrema_TriangleSet > &theSet2, const BRepExtrema_ShapeList &theShapeList1, const BRepExtrema_ShapeList &theShapeList2) | |
Creates new tool for the given element sets. | |
void | LoadTriangleSets (const Handle< BRepExtrema_TriangleSet > &theSet1, const Handle< BRepExtrema_TriangleSet > &theSet2) |
Loads the given element sets into the tool. | |
void | LoadShapeLists (const BRepExtrema_ShapeList &theShapeList1, const BRepExtrema_ShapeList &theShapeList2) |
Loads the given list of subshapes into the tool. | |
void | LoadAdditionalPointsFirstSet (const BVH_Array3d &theAddVertices1, const NCollection_Vector< ProxPnt_Status > &theAddStatus1) |
Loads given additional vertices and their statuses. | |
void | Perform () |
Performs searching of the proximity distance. | |
![]() | |
BVH_Distance () | |
void | SetObject (const BVH_Vec3d &theObject) |
Standard_Real | ComputeDistance () |
Standard_Boolean | IsDone () const |
Returns the computed distance. | |
Standard_Real | Distance () const |
Returns the computed distance. | |
virtual Standard_Boolean | IsMetricBetter (const Standard_Real &theLeft, const Standard_Real &theRight) const override |
Rejects the branch by the metric. | |
virtual Standard_Boolean | RejectMetric (const Standard_Real &theMetric) const override |
Rejects the branch by the metric. | |
virtual Standard_Boolean | Stop () const override |
Returns the flag controlling the tree descend. | |
![]() | |
BVH_Traverse () | |
void | SetBVHSet (BRepExtrema_TriangleSet *theBVHSet) |
virtual Standard_Boolean | AcceptMetric (const Standard_Real &) 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 Standard_Boolean | RejectNode (const BVH_VecNt &theCornerMin, const BVH_VecNt &theCornerMax, Standard_Real &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. | |
Standard_Integer | Select () |
Performs selection of the elements from the BVH tree by the rules defined in Accept/Reject methods. Returns the number of accepted elements. | |
Standard_Integer | Select (const opencascade::handle< BVH_Tree< Standard_Real, 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. | |
![]() |
Reject/Accept implementations | |
Defines the rules for node rejection by bounding box. | |
Standard_Real | 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. | |
Standard_Real | 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. | |
virtual Standard_Boolean | RejectNode (const BVH_Vec3d &theCornerMin, const BVH_Vec3d &theCornerMax, Standard_Real &theMetric) const override |
Minimal distance from point to BVH, could be not equal to myDistance. | |
virtual Standard_Boolean | Accept (const Standard_Integer theSgmIdx, const Standard_Real &) 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. | |
Standard_Real | ProximityDistance () const |
Returns the computed distance. | |
static Standard_Boolean | IsNodeOnBorder (const Standard_Integer theNodeIdx, const Handle< Poly_Triangulation > &theTr) |
Returns true if the node is on the boarder. | |
static Standard_Boolean | IsEdgeOnBorder (const Standard_Integer theTrgIdx, const Standard_Integer theFirstEdgeNodeIdx, const Standard_Integer theSecondEdgeNodeIdx, const Handle< Poly_Triangulation > &theTr) |
Returns true if the edge is on the boarder. | |
Standard_Real | ComputeDistance () |
Computes the distance between object and BVH tree. | |
void | DefineStatusProxPnt () |
Defines the status of proximity points. | |
Additional Inherited Members | |
![]() | |
BVH_BaseTraverse () | |
Destructor. | |
virtual | ~BVH_BaseTraverse () |
Destructor. | |
![]() | |
Standard_Real | myDistance |
Distance. | |
Standard_Boolean | myIsDone |
State of the algorithm. | |
BVH_Vec3d | myObject |
Object to compute the distance to. | |
![]() | |
BRepExtrema_TriangleSet * | myBVHSet |
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).
typedef BVH_Tools<Standard_Real,3>::BVH_PrjStateInTriangle BRepExtrema_ProximityDistTool::BVH_PrjState |
BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool | ( | ) |
Creates new uninitialized tool.
BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool | ( | const Handle< BRepExtrema_TriangleSet > & | theSet1, |
const Standard_Integer | theNbSamples1, | ||
const BVH_Array3d & | theAddVertices1, | ||
const NCollection_Vector< ProxPnt_Status > & | theAddStatus1, | ||
const Handle< BRepExtrema_TriangleSet > & | theSet2, | ||
const BRepExtrema_ShapeList & | theShapeList1, | ||
const BRepExtrema_ShapeList & | theShapeList2 ) |
Creates new tool for the given element sets.
|
overridevirtual |
Defines the rules for leaf acceptance.
Implements BVH_Traverse< Standard_Real, Dimension, BRepExtrema_TriangleSet, Standard_Real >.
|
protected |
Computes the distance between object and BVH tree.
|
protected |
Defines the status of proximity points.
|
static |
Returns true if the edge is on the boarder.
|
static |
Returns true if the node is on the boarder.
void BRepExtrema_ProximityDistTool::LoadAdditionalPointsFirstSet | ( | const BVH_Array3d & | theAddVertices1, |
const NCollection_Vector< ProxPnt_Status > & | theAddStatus1 ) |
Loads given additional vertices and their statuses.
void BRepExtrema_ProximityDistTool::LoadShapeLists | ( | const BRepExtrema_ShapeList & | theShapeList1, |
const BRepExtrema_ShapeList & | theShapeList2 ) |
Loads the given list of subshapes into the tool.
void BRepExtrema_ProximityDistTool::LoadTriangleSets | ( | const Handle< BRepExtrema_TriangleSet > & | theSet1, |
const Handle< BRepExtrema_TriangleSet > & | theSet2 ) |
Loads the given element sets into the tool.
void BRepExtrema_ProximityDistTool::Perform | ( | ) |
Performs searching of the proximity distance.
|
inline |
Returns the computed distance.
|
inline |
Returns points on triangles sets, which provide the proximity distance.
|
inline |
Returns status of points on triangles sets, which provide the proximity distance.
|
overridevirtual |
Minimal distance from point to BVH, could be not equal to myDistance.
|
protected |
Point on BVH providing the extrema.
|
protected |
Minimal distance from point to BVH, could be not equal to myDistance.
|
protected |
Point on BVH providing the minimal distance.
|
protected |
Proximity points.
|
protected |
Minimal distance from point to BVH, could be not equal to myDistance.
|
protected |
Proximity points' status.
|
protected |
Minimal distance from point to BVH, could be not equal to myDistance.
|
protected |
Proximity distance.