mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0032337: Visualization - rename Overlaps() method in selection to more self-describable names
- renamed Overlaps and hasOverlap overloaded methods to self-describable names
This commit is contained in:
@@ -194,12 +194,12 @@ bool SelectMgr_AxisIntersector::rayPlaneIntersection (const gp_Vec& thePlane,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -218,13 +218,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theB
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -250,12 +250,12 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theB
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -273,10 +273,10 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint (const gp_Pnt& thePnt) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -286,13 +286,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt) cons
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -306,13 +306,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -352,7 +352,7 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt&
|
||||
if (aPolyNorm.Magnitude() <= Precision::Confusion())
|
||||
{
|
||||
// treat degenerated polygon as point
|
||||
return Overlaps (theArrayOfPnts.First(), theClipRange, thePickResult);
|
||||
return OverlapsPoint (theArrayOfPnts.First(), theClipRange, thePickResult);
|
||||
}
|
||||
else if (!rayPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult))
|
||||
{
|
||||
@@ -364,15 +364,15 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt&
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_AxisIntersector::OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
|
||||
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
|
||||
@@ -381,7 +381,7 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
|
||||
{
|
||||
const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
|
||||
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4);
|
||||
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
}
|
||||
else if (theSensType == Select3D_TOS_INTERIOR)
|
||||
{
|
||||
@@ -394,10 +394,10 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
|
||||
{
|
||||
// consider degenerated triangle as point or segment
|
||||
return aTrEdges[0].SquareModulus() > gp::Resolution()
|
||||
? Overlaps (thePnt1, thePnt2, theClipRange, thePickResult)
|
||||
? OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult)
|
||||
: (aTrEdges[1].SquareModulus() > gp::Resolution()
|
||||
? Overlaps (thePnt2, thePnt3, theClipRange, thePickResult)
|
||||
: Overlaps (thePnt1, theClipRange, thePickResult));
|
||||
? OverlapsSegment (thePnt2, thePnt3, theClipRange, thePickResult)
|
||||
: OverlapsPoint (thePnt1, theClipRange, thePickResult));
|
||||
}
|
||||
|
||||
const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3};
|
||||
|
@@ -49,48 +49,48 @@ public:
|
||||
public:
|
||||
|
||||
//! Intersection test between defined axis and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if selecting axis intersects axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined axis and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined axis and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined axis and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Checks if selecting axis intersects line segment
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined axis and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -144,89 +144,89 @@ void SelectMgr_BaseFrustum::SetBuilder (const Handle(SelectMgr_FrustumBuilder)&
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : SAT intersection test between defined volume and
|
||||
// given axis-aligned box
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theBoxMin*/,
|
||||
const SelectMgr_Vec3& /*theBoxMax*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsBox (const SelectMgr_Vec3& /*theBoxMin*/,
|
||||
const SelectMgr_Vec3& /*theBoxMax*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theBoxMin*/,
|
||||
const SelectMgr_Vec3& /*theBoxMax*/,
|
||||
Standard_Boolean* /*theInside*/) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsBox (const SelectMgr_Vec3& /*theBoxMin*/,
|
||||
const SelectMgr_Vec3& /*theBoxMax*/,
|
||||
Standard_Boolean* /*theInside*/) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsPoint (const gp_Pnt& /*thePnt*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt*/) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsPoint (const gp_Pnt& /*thePnt*/) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// ordered set of points, representing line segments. The test
|
||||
// may be considered of interior part or boundary line defined
|
||||
// by segments depending on given sensitivity type
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const TColgp_Array1OfPnt& /*theArrayOfPnts*/,
|
||||
Select3D_TypeOfSensitivity /*theSensType*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& /*theArrayOfPnts*/,
|
||||
Select3D_TypeOfSensitivity /*theSensType*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// triangle. The test may be considered of interior part or
|
||||
// boundary line defined by triangle vertices depending on
|
||||
// given sensitivity type
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/,
|
||||
const gp_Pnt& /*thePt2*/,
|
||||
const gp_Pnt& /*thePt3*/,
|
||||
Select3D_TypeOfSensitivity /*theSensType*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsTriangle (const gp_Pnt& /*thePt1*/,
|
||||
const gp_Pnt& /*thePt2*/,
|
||||
const gp_Pnt& /*thePt3*/,
|
||||
Select3D_TypeOfSensitivity /*theSensType*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose : Checks if line segment overlaps selecting volume
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt1*/,
|
||||
const gp_Pnt& /*thePnt2*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
Standard_Boolean SelectMgr_BaseFrustum::OverlapsSegment (const gp_Pnt& /*thePnt1*/,
|
||||
const gp_Pnt& /*thePnt2*/,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -75,51 +75,51 @@ public:
|
||||
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
//! Does not perform depth calculation, so this method is defined as
|
||||
//! helper function for inclusion test. Therefore, its implementation
|
||||
//! makes sense only for rectangular frustum with box selection mode activated.
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
|
@@ -165,83 +165,83 @@ const gp_Pnt2d& SelectMgr_BaseIntersector::GetMousePosition() const
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const SelectMgr_Vec3&,
|
||||
const SelectMgr_Vec3&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsBox (const SelectMgr_Vec3&,
|
||||
const SelectMgr_Vec3&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const SelectMgr_Vec3&,
|
||||
const SelectMgr_Vec3&,
|
||||
Standard_Boolean*) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsBox (const SelectMgr_Vec3&,
|
||||
const SelectMgr_Vec3&,
|
||||
Standard_Boolean*) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsPoint (const gp_Pnt&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt& thePnt) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsPoint (const gp_Pnt& thePnt) const
|
||||
{
|
||||
(void )thePnt;
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const TColgp_Array1OfPnt&,
|
||||
Select3D_TypeOfSensitivity,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsPolygon (const TColgp_Array1OfPnt&,
|
||||
Select3D_TypeOfSensitivity,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
Select3D_TypeOfSensitivity,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsTriangle (const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
Select3D_TypeOfSensitivity,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
Standard_Boolean SelectMgr_BaseIntersector::OverlapsSegment (const gp_Pnt&,
|
||||
const gp_Pnt&,
|
||||
const SelectMgr_ViewClipRange&,
|
||||
SelectBasics_PickResult&) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -150,51 +150,51 @@ public:
|
||||
public:
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
//! Does not perform depth calculation, so this method is defined as
|
||||
//! helper function for inclusion test. Therefore, its implementation
|
||||
//! makes sense only for rectangular frustum with box selection mode activated.
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const;
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -67,26 +67,26 @@ protected:
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_Boolean hasOverlap (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const;
|
||||
Standard_Boolean hasBoxOverlap (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const;
|
||||
|
||||
//! SAT intersection test between defined volume and given point
|
||||
Standard_Boolean hasOverlap (const gp_Pnt& thePnt) const;
|
||||
Standard_Boolean hasPointOverlap (const gp_Pnt& thePnt) const;
|
||||
|
||||
//! SAT intersection test between defined volume and given segment
|
||||
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2) const;
|
||||
Standard_Boolean hasSegmentOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2) const;
|
||||
|
||||
//! SAT intersection test between frustum given and planar convex polygon represented as ordered point set
|
||||
Standard_Boolean hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
gp_Vec& theNormal) const;
|
||||
Standard_Boolean hasPolygonOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
gp_Vec& theNormal) const;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle
|
||||
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
gp_Vec& theNormal) const;
|
||||
Standard_Boolean hasTriangleOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
gp_Vec& theNormal) const;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -122,15 +122,15 @@ Standard_Boolean SelectMgr_Frustum<N>::isSeparated (const gp_Pnt& thePnt1,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : hasOverlap
|
||||
// function : hasBoxOverlap
|
||||
// purpose : Returns true if selecting volume is overlapped by
|
||||
// axis-aligned bounding box with minimum corner at point
|
||||
// theMinPnt and maximum at point theMaxPnt
|
||||
// =======================================================================
|
||||
template <int N>
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasBoxOverlap (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const
|
||||
{
|
||||
for (Standard_Integer anAxis = 0; anAxis < 3; ++anAxis)
|
||||
{
|
||||
@@ -200,11 +200,11 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinP
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : hasOverlap
|
||||
// function : hasPointOverlap
|
||||
// purpose : SAT intersection test between defined volume and given point
|
||||
// =======================================================================
|
||||
template <int N>
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt) const
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasPointOverlap (const gp_Pnt& thePnt) const
|
||||
{
|
||||
const Standard_Integer anIncFactor = (myIsOrthographic && N == 4) ? 2 : 1;
|
||||
|
||||
@@ -223,12 +223,12 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt) const
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : hasOverlap
|
||||
// function : hasSegmentOverlap
|
||||
// purpose : SAT intersection test between defined volume and given segment
|
||||
// =======================================================================
|
||||
template <int N>
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
|
||||
const gp_Pnt& theEndPnt) const
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasSegmentOverlap (const gp_Pnt& theStartPnt,
|
||||
const gp_Pnt& theEndPnt) const
|
||||
{
|
||||
const gp_XYZ& aDir = theEndPnt.XYZ() - theStartPnt.XYZ();
|
||||
if (aDir.Modulus() < Precision::Confusion())
|
||||
@@ -304,13 +304,13 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : hasOverlap
|
||||
// function : hasPolygonOverlap
|
||||
// purpose : SAT intersection test between frustum given and planar convex
|
||||
// polygon represented as ordered point set
|
||||
// =======================================================================
|
||||
template <int N>
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
gp_Vec& theNormal) const
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasPolygonOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
gp_Vec& theNormal) const
|
||||
{
|
||||
Standard_Integer aStartIdx = theArrayOfPnts.Lower();
|
||||
Standard_Integer anEndIdx = theArrayOfPnts.Upper();
|
||||
@@ -400,14 +400,14 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const TColgp_Array1OfPnt& the
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : hasOverlap
|
||||
// function : hasTriangleOverlap
|
||||
// purpose : SAT intersection test between defined volume and given triangle
|
||||
// =======================================================================
|
||||
template <int N>
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
gp_Vec& theNormal) const
|
||||
Standard_Boolean SelectMgr_Frustum<N>::hasTriangleOverlap (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
gp_Vec& theNormal) const
|
||||
{
|
||||
const gp_XYZ aTrEdges[3] = { thePnt2.XYZ() - thePnt1.XYZ(),
|
||||
thePnt3.XYZ() - thePnt2.XYZ(),
|
||||
|
@@ -457,35 +457,35 @@ Standard_Boolean SelectMgr_RectangularFrustum::IsScalable() const
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : Returns true if selecting volume is overlapped by
|
||||
// axis-aligned bounding box with minimum corner at point
|
||||
// theMinPnt and maximum at point theMaxPnt
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
return hasOverlap (theBoxMin, theBoxMax, theInside);
|
||||
return hasBoxOverlap (theBoxMin, theBoxMax, theInside);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : SAT intersection test between defined volume and
|
||||
// given axis-aligned box
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
if (!hasOverlap (theBoxMin, theBoxMax))
|
||||
if (!hasBoxOverlap (theBoxMin, theBoxMax))
|
||||
return Standard_False;
|
||||
|
||||
Standard_Real aDepth = 0.0;
|
||||
@@ -518,17 +518,17 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& t
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
if (!hasOverlap (thePnt))
|
||||
if (!hasPointOverlap (thePnt))
|
||||
return Standard_False;
|
||||
|
||||
gp_XYZ aV = thePnt.XYZ() - myNearPickedPnt.XYZ();
|
||||
@@ -541,30 +541,30 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPoint (const gp_Pnt& thePnt) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
return hasOverlap (thePnt);
|
||||
return hasPointOverlap (thePnt);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose : Checks if line segment overlaps selecting frustum
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
if (!hasOverlap (thePnt1, thePnt2))
|
||||
if (!hasSegmentOverlap (thePnt1, thePnt2))
|
||||
return Standard_False;
|
||||
|
||||
segmentSegmentDistance (thePnt1, thePnt2, thePickResult);
|
||||
@@ -573,16 +573,16 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// ordered set of points, representing line segments. The test
|
||||
// may be considered of interior part or boundary line defined
|
||||
// by segments depending on given sensitivity type
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
@@ -598,7 +598,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
|
||||
{
|
||||
const gp_Pnt& aStartPnt = theArrayOfPnts.Value (aPntIter);
|
||||
const gp_Pnt& aEndPnt = theArrayOfPnts.Value (aPntIter == anUpper ? aLower : (aPntIter + 1));
|
||||
if (hasOverlap (aStartPnt, aEndPnt))
|
||||
if (hasSegmentOverlap (aStartPnt, aEndPnt))
|
||||
{
|
||||
aMatchingSegmentsNb++;
|
||||
segmentSegmentDistance (aStartPnt, aEndPnt, aPickResult);
|
||||
@@ -612,7 +612,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
|
||||
else if (theSensType == Select3D_TOS_INTERIOR)
|
||||
{
|
||||
gp_Vec aPolyNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
|
||||
if (!hasOverlap (theArrayOfPnts, aPolyNorm))
|
||||
if (!hasPolygonOverlap (theArrayOfPnts, aPolyNorm))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
|
||||
if (aPolyNorm.Magnitude() <= Precision::Confusion())
|
||||
{
|
||||
// treat degenerated polygon as point
|
||||
return Overlaps (theArrayOfPnts.First(), theClipRange, thePickResult);
|
||||
return OverlapsPoint (theArrayOfPnts.First(), theClipRange, thePickResult);
|
||||
}
|
||||
else if (!segmentPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult))
|
||||
{
|
||||
@@ -632,18 +632,18 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// triangle. The test may be considered of interior part or
|
||||
// boundary line defined by triangle vertices depending on
|
||||
// given sensitivity type
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
|
||||
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
|
||||
@@ -652,12 +652,12 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
{
|
||||
const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
|
||||
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4);
|
||||
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
}
|
||||
else if (theSensType == Select3D_TOS_INTERIOR)
|
||||
{
|
||||
gp_Vec aTriangleNormal (gp_XYZ (RealLast(), RealLast(), RealLast()));
|
||||
if (!hasOverlap (thePnt1, thePnt2, thePnt3, aTriangleNormal))
|
||||
if (!hasTriangleOverlap (thePnt1, thePnt2, thePnt3, aTriangleNormal))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -669,10 +669,10 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
{
|
||||
// consider degenerated triangle as point or segment
|
||||
return aTrEdges[0].SquareModulus() > gp::Resolution()
|
||||
? Overlaps (thePnt1, thePnt2, theClipRange, thePickResult)
|
||||
? OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult)
|
||||
: (aTrEdges[1].SquareModulus() > gp::Resolution()
|
||||
? Overlaps (thePnt2, thePnt3, theClipRange, thePickResult)
|
||||
: Overlaps (thePnt1, theClipRange, thePickResult));
|
||||
? OverlapsSegment (thePnt2, thePnt3, theClipRange, thePickResult)
|
||||
: OverlapsPoint (thePnt1, theClipRange, thePickResult));
|
||||
}
|
||||
|
||||
const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3};
|
||||
|
@@ -90,48 +90,48 @@ public:
|
||||
// SAT Tests for different objects
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Measures distance between 3d projection of user-picked
|
||||
//! screen point and given point theCOG.
|
||||
|
@@ -329,143 +329,143 @@ void SelectMgr_SelectingVolumeManager::BuildSelectingVolume (const TColgp_Array1
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : SAT intersection test between defined volume and
|
||||
// given axis-aligned box
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (theBoxMin, theBoxMax, myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsBox (theBoxMin, theBoxMax, myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (theBoxMin, theBoxMax, theInside);
|
||||
return myActiveSelectingVolume->OverlapsBox (theBoxMin, theBoxMax, theInside);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePnt,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPoint (const gp_Pnt& thePnt,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (thePnt, myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsPoint (thePnt, myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePnt) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPoint (const gp_Pnt& thePnt) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (thePnt);
|
||||
return myActiveSelectingVolume->OverlapsPoint (thePnt);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// ordered set of points, representing line segments. The test
|
||||
// may be considered of interior part or boundary line defined
|
||||
// by segments depending on given sensitivity type
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPolygon (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (theArrayOfPnts->Array1(), (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsPolygon (theArrayOfPnts->Array1(), (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// ordered set of points, representing line segments. The test
|
||||
// may be considered of interior part or boundary line defined
|
||||
// by segments depending on given sensitivity type
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (theArrayOfPnts, (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsPolygon (theArrayOfPnts, (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose : Checks if line segment overlaps selecting volume
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsSegment (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (thePt1, thePt2, myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsSegment (thePt1, thePt2, myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// triangle. The test may be considered of interior part or
|
||||
// boundary line defined by triangle vertices depending on
|
||||
// given sensitivity type
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsTriangle (const gp_Pnt& thePt1,
|
||||
const gp_Pnt& thePt2,
|
||||
const gp_Pnt& thePt3,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (myActiveSelectingVolume.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
return myActiveSelectingVolume->Overlaps (thePt1, thePt2, thePt3, (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
return myActiveSelectingVolume->OverlapsTriangle (thePt1, thePt2, thePt3, (Select3D_TypeOfSensitivity)theSensType,
|
||||
myViewClipRange, thePickResult);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -130,51 +130,50 @@ public:
|
||||
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Measures distance between 3d projection of user-picked
|
||||
//! screen point and given point theCOG
|
||||
@@ -271,6 +270,84 @@ public:
|
||||
Standard_DEPRECATED("Deprecated method - InitPolylineSelectingVolume() and Build() should be used instead")
|
||||
Standard_EXPORT void BuildSelectingVolume (const TColgp_Array1OfPnt2d& thePoints);
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsBox() should be used instead")
|
||||
Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsBox (theBoxMin, theBoxMax, thePickResult);
|
||||
}
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsBox() should be used instead")
|
||||
Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
const SelectMgr_Vec3& theBoxMax,
|
||||
Standard_Boolean* theInside = NULL) const
|
||||
{
|
||||
return OverlapsBox (theBoxMin, theBoxMax, theInside);
|
||||
}
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsPoint() should be used instead")
|
||||
Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsPoint (thePnt, thePickResult);
|
||||
}
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsPoint() should be used instead")
|
||||
Standard_Boolean Overlaps (const gp_Pnt& thePnt) const
|
||||
{
|
||||
return OverlapsPoint (thePnt);
|
||||
}
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsPolygon() should be used instead")
|
||||
Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsPolygon (theArrayOfPts, theSensType, thePickResult);
|
||||
}
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsPolygon() should be used instead")
|
||||
Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsPolygon (theArrayOfPts, theSensType, thePickResult);
|
||||
}
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsSegment() should be used instead")
|
||||
Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsSegment (thePnt1, thePnt2, thePickResult);
|
||||
}
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_DEPRECATED ("Deprecated method - OverlapsTriangle() should be used instead")
|
||||
Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Standard_Integer theSensType,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
return OverlapsTriangle (thePnt1, thePnt2, thePnt3, theSensType, thePickResult);
|
||||
}
|
||||
|
||||
private:
|
||||
Handle(SelectMgr_BaseIntersector) myActiveSelectingVolume;
|
||||
Handle(Graphic3d_SequenceOfHClipPlane) myViewClipPlanes; //!< view clipping planes
|
||||
|
@@ -177,53 +177,53 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_TriangularFrustum::ScaleAndTransform
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : SAT intersection test between defined volume and
|
||||
// given axis-aligned box
|
||||
//=======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsBox (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
{
|
||||
return hasOverlap (theMinPt, theMaxPt);
|
||||
return hasBoxOverlap (theMinPt, theMaxPt);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose : Returns true if selecting volume is overlapped by
|
||||
// axis-aligned bounding box with minimum corner at point
|
||||
// theMinPt and maximum at point theMaxPt
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
Standard_Boolean* /*theInside*/) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsBox (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
Standard_Boolean* /*theInside*/) const
|
||||
{
|
||||
return hasOverlap (theMinPt, theMaxPt, NULL);
|
||||
return hasBoxOverlap (theMinPt, theMaxPt, NULL);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose : Intersection test between defined volume and given point
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
{
|
||||
return hasOverlap (thePnt);
|
||||
return hasPointOverlap (thePnt);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// ordered set of points, representing line segments. The test
|
||||
// may be considered of interior part or boundary line defined
|
||||
// by segments depending on given sensitivity type
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
{
|
||||
if (theSensType == Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt
|
||||
{
|
||||
const gp_Pnt& aStartPt = theArrayOfPnts.Value (aPtIdx);
|
||||
const gp_Pnt& aEndPt = theArrayOfPnts.Value (aPtIdx == anUpper ? aLower : (aPtIdx + 1));
|
||||
if (!hasOverlap (aStartPt, aEndPt))
|
||||
if (!hasSegmentOverlap (aStartPt, aEndPt))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -242,48 +242,48 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt
|
||||
else if (theSensType == Select3D_TOS_INTERIOR)
|
||||
{
|
||||
gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
|
||||
return hasOverlap (theArrayOfPnts, aNorm);
|
||||
return hasPolygonOverlap (theArrayOfPnts, aNorm);
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose : Checks if line segment overlaps selecting frustum
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& /*theClipRange*/,
|
||||
SelectBasics_PickResult& /*thePickResult*/) const
|
||||
{
|
||||
return hasOverlap (thePnt1, thePnt2);
|
||||
return hasSegmentOverlap (thePnt1, thePnt2);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose : SAT intersection test between defined volume and given
|
||||
// triangle. The test may be considered of interior part or
|
||||
// boundary line defined by triangle vertices depending on
|
||||
// given sensitivity type
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustum::OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
if (theSensType == Select3D_TOS_BOUNDARY)
|
||||
{
|
||||
const gp_Pnt aPntsArrayBuf[3] = { thePnt1, thePnt2, thePnt3 };
|
||||
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 3);
|
||||
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
|
||||
}
|
||||
else if (theSensType == Select3D_TOS_INTERIOR)
|
||||
{
|
||||
gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
|
||||
return hasOverlap (thePnt1, thePnt2, thePnt3, aNorm);
|
||||
return hasTriangleOverlap (thePnt1, thePnt2, thePnt3, aNorm);
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
|
@@ -60,45 +60,45 @@ public:
|
||||
// SAT Tests for different objects
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
|
||||
//! with minimum corner at point theMinPt and maximum at point theMaxPt
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPt,
|
||||
const SelectMgr_Vec3& theMaxPt,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
|
||||
//! Intersection test between defined volume and given point
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given ordered set of points,
|
||||
//! representing line segments. The test may be considered of interior part or
|
||||
//! boundary line defined by segments depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Checks if line segment overlaps selecting frustum
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! SAT intersection test between defined volume and given triangle. The test may
|
||||
//! be considered of interior part or boundary line defined by triangle vertices
|
||||
//! depending on given sensitivity type
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Nullifies the handle to corresponding builder instance to prevent memory leaks
|
||||
Standard_EXPORT void Clear();
|
||||
|
@@ -171,20 +171,20 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_TriangularFrustumSet::ScaleAndTransf
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (theMinPnt, theMaxPnt, theClipRange, thePickResult))
|
||||
if (anIter.Value()->OverlapsBox (theMinPnt, theMaxPnt, theClipRange, thePickResult))
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -192,19 +192,19 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3&
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsBox
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (theMinPnt, theMaxPnt, NULL))
|
||||
if (anIter.Value()->OverlapsBox (theMinPnt, theMaxPnt, NULL))
|
||||
{
|
||||
if (myToAllowOverlap || theInside == NULL)
|
||||
{
|
||||
@@ -243,19 +243,19 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3&
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPoint
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (thePnt, theClipRange, thePickResult))
|
||||
if (anIter.Value()->OverlapsPoint (thePnt, theClipRange, thePickResult))
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -263,20 +263,20 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsPolygon
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (theArrayOfPts, theSensType, theClipRange, thePickResult))
|
||||
if (anIter.Value()->OverlapsPolygon (theArrayOfPts, theSensType, theClipRange, thePickResult))
|
||||
{
|
||||
if (myToAllowOverlap)
|
||||
{
|
||||
@@ -302,20 +302,20 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const TColgp_Array1Of
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsSegment
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (thePnt1, thePnt2, theClipRange, thePickResult))
|
||||
if (anIter.Value()->OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult))
|
||||
{
|
||||
if (myToAllowOverlap)
|
||||
{
|
||||
@@ -336,22 +336,22 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Overlaps
|
||||
// function : OverlapsTriangle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const
|
||||
{
|
||||
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
|
||||
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
|
||||
|
||||
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Overlaps (thePnt1, thePnt2, thePnt3, theSensType, theClipRange, thePickResult))
|
||||
if (anIter.Value()->OverlapsTriangle (thePnt1, thePnt2, thePnt3, theSensType, theClipRange, thePickResult))
|
||||
{
|
||||
if (myToAllowOverlap)
|
||||
{
|
||||
|
@@ -58,35 +58,35 @@ public:
|
||||
const gp_GTrsf& theTrsf,
|
||||
const Handle(SelectMgr_FrustumBuilder)& theBuilder) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
Standard_Boolean* theInside) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
|
||||
const gp_Pnt& thePnt2,
|
||||
const gp_Pnt& thePnt3,
|
||||
Select3D_TypeOfSensitivity theSensType,
|
||||
const SelectMgr_ViewClipRange& theClipRange,
|
||||
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
|
||||
|
||||
//! Calculates the point on a view ray that was detected during the run of selection algo by given depth
|
||||
Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;
|
||||
|
@@ -405,8 +405,8 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
||||
SelectMgr_SelectingVolumeManager aMgr = aInversedTrsf.Form() != gp_Identity
|
||||
? theMgr.ScaleAndTransform (1, aInversedTrsf, NULL)
|
||||
: theMgr;
|
||||
if (!aMgr.Overlaps (aSensitivesTree->MinPoint (0),
|
||||
aSensitivesTree->MaxPoint (0)))
|
||||
if (!aMgr.OverlapsBox (aSensitivesTree->MinPoint (0),
|
||||
aSensitivesTree->MaxPoint (0)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -487,10 +487,10 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
||||
{
|
||||
const Standard_Integer aLeftChildIdx = aSensitivesTree->Child<0> (aNode);
|
||||
const Standard_Integer aRightChildIdx = aSensitivesTree->Child<1> (aNode);
|
||||
const Standard_Boolean isLeftChildIn = aMgr.Overlaps (aSensitivesTree->MinPoint (aLeftChildIdx),
|
||||
aSensitivesTree->MaxPoint (aLeftChildIdx));
|
||||
const Standard_Boolean isRightChildIn = aMgr.Overlaps (aSensitivesTree->MinPoint (aRightChildIdx),
|
||||
aSensitivesTree->MaxPoint (aRightChildIdx));
|
||||
const Standard_Boolean isLeftChildIn = aMgr.OverlapsBox (aSensitivesTree->MinPoint (aLeftChildIdx),
|
||||
aSensitivesTree->MaxPoint (aLeftChildIdx));
|
||||
const Standard_Boolean isRightChildIn = aMgr.OverlapsBox (aSensitivesTree->MinPoint (aRightChildIdx),
|
||||
aSensitivesTree->MaxPoint (aRightChildIdx));
|
||||
if (isLeftChildIn
|
||||
&& isRightChildIn)
|
||||
{
|
||||
@@ -680,7 +680,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
||||
const opencascade::handle<BVH_Tree<Standard_Real, 3> >& aBVHTree = mySelectableObjects.BVH (aBVHSubset);
|
||||
|
||||
Standard_Integer aNode = 0;
|
||||
if (!aMgr.Overlaps (aBVHTree->MinPoint (0), aBVHTree->MaxPoint (0)))
|
||||
if (!aMgr.OverlapsBox (aBVHTree->MinPoint (0), aBVHTree->MaxPoint (0)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -694,9 +694,9 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
||||
const Standard_Integer aLeftChildIdx = aBVHTree->Child<0> (aNode);
|
||||
const Standard_Integer aRightChildIdx = aBVHTree->Child<1> (aNode);
|
||||
const Standard_Boolean isLeftChildIn =
|
||||
aMgr.Overlaps (aBVHTree->MinPoint (aLeftChildIdx), aBVHTree->MaxPoint (aLeftChildIdx));
|
||||
aMgr.OverlapsBox (aBVHTree->MinPoint (aLeftChildIdx), aBVHTree->MaxPoint (aLeftChildIdx));
|
||||
const Standard_Boolean isRightChildIn =
|
||||
aMgr.Overlaps (aBVHTree->MinPoint (aRightChildIdx), aBVHTree->MaxPoint (aRightChildIdx));
|
||||
aMgr.OverlapsBox (aBVHTree->MinPoint (aRightChildIdx), aBVHTree->MaxPoint (aRightChildIdx));
|
||||
if (isLeftChildIn
|
||||
&& isRightChildIn)
|
||||
{
|
||||
|
Reference in New Issue
Block a user