1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026069: Coding Rules - eliminate new warnings about redundant const qualifier in SelectMgr

SelectMgr_SensitiveEntity is now inherited from Standard_Transient;
Redundant const type qualifiers were removed from selection classes.
This commit is contained in:
vpa
2015-04-23 01:12:55 +03:00
committed by bugmaster
parent e99a2f7cae
commit 7ab159522a
25 changed files with 275 additions and 269 deletions

View File

@@ -35,12 +35,12 @@ public:
myDistToCenter (theDistToCenter) {}
public:
inline const Standard_Real Depth() const
inline Standard_Real Depth() const
{
return myDepth;
}
inline const Standard_Real DistToGeomCenter() const
inline Standard_Real DistToGeomCenter() const
{
return myDistToCenter;
}

View File

@@ -41,44 +41,44 @@ public:
virtual ~SelectBasics_SelectingVolumeManager() {};
virtual const Standard_Integer GetActiveSelectionType() const = 0;
virtual Standard_Integer GetActiveSelectionType() const = 0;
//! Returns true if selecting volume is overlapped by box theBox
virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) = 0;
virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) = 0;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box with minimum
//! corner at point theMinPt and maximum at point theMaxPt
virtual const Standard_Boolean Overlaps (const NCollection_Vec3<Standard_Real>& theMinPt,
const NCollection_Vec3<Standard_Real>& theMaxPt) = 0;
virtual Standard_Boolean Overlaps (const NCollection_Vec3<Standard_Real>& theMinPt,
const NCollection_Vec3<Standard_Real>& theMaxPt) = 0;
//! Returns true if selecting volume is overlapped by point thePt
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) = 0;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) = 0;
//! Returns true if selecting volume is overlapped by planar convex polygon, which points
//! are stored in theArrayOfPts, taking into account sensitivity type theSensType
virtual const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth) = 0;
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth) = 0;
//! Returns true if selecting volume is overlapped by line segment with start point at thePt1
//! and end point at thePt2
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) = 0;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) = 0;
//! Returns true if selecting volume is overlapped by triangle with vertices thePt1,
//! thePt2 and thePt3, taking into account sensitivity type theSensType
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth) = 0;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth) = 0;
//! Calculates distance from 3d projection of user-defined selection point
//! to the given point theCOG
virtual const Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) = 0;
virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) = 0;
virtual NCollection_Vec3<Standard_Real> DetectedPoint (const Standard_Real theDepth) const = 0;

View File

@@ -97,8 +97,8 @@ void SelectMgr_BaseFrustum::SetBuilder (const NCollection_Handle<SelectMgr_Frust
// purpose : SAT intersection test between defined volume and
// given axis-aligned box
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& /*theBndBox*/,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& /*theBndBox*/,
Standard_Real& /*theDepth*/)
{
return Standard_False;
}
@@ -107,8 +107,8 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const BVH_Box<Standard_R
// function : Overlaps
// purpose : Intersection test between defined volume and given point
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theMinPt*/,
const SelectMgr_Vec3& /*theMaxPt*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theMinPt*/,
const SelectMgr_Vec3& /*theMaxPt*/)
{
return Standard_False;
}
@@ -117,8 +117,8 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*
// function : Overlaps
// purpose : Intersection test between defined volume and given point
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt*/,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt*/,
Standard_Real& /*theDepth*/)
{
return Standard_False;
}
@@ -130,9 +130,9 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt*/,
// may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& /*theArrayOfPts*/,
Select3D_TypeOfSensitivity /*theSensType*/,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& /*theArrayOfPts*/,
Select3D_TypeOfSensitivity /*theSensType*/,
Standard_Real& /*theDepth*/)
{
return Standard_False;
}
@@ -144,11 +144,11 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const Handle(TColgp_HArr
// boundary line defined by triangle vertices depending on
// given sensitivity type
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/,
const gp_Pnt& /*thePt2*/,
const gp_Pnt& /*thePt3*/,
Select3D_TypeOfSensitivity /*theSensType*/,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/,
const gp_Pnt& /*thePt2*/,
const gp_Pnt& /*thePt3*/,
Select3D_TypeOfSensitivity /*theSensType*/,
Standard_Real& /*theDepth*/)
{
return Standard_False;
}
@@ -157,9 +157,9 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/
// function : Overlaps
// purpose : Checks if line segment overlaps selecting volume
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/,
const gp_Pnt& /*thePt2*/,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/,
const gp_Pnt& /*thePt2*/,
Standard_Real& /*theDepth*/)
{
return Standard_False;
}
@@ -169,7 +169,7 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/
// purpose : Measures distance between 3d projection of user-picked
// screen point and given point theCOG
//=======================================================================
const Standard_Real SelectMgr_BaseFrustum::DistToGeometryCenter (const gp_Pnt& /*theCOG*/)
Standard_Real SelectMgr_BaseFrustum::DistToGeometryCenter (const gp_Pnt& /*theCOG*/)
{
return DBL_MAX;
}
@@ -184,8 +184,8 @@ SelectMgr_Vec3 SelectMgr_BaseFrustum::DetectedPoint (const Standard_Real /*theDe
// purpose : Checks if the point of sensitive in which selection was
// detected belongs to the region defined by clipping planes
//=======================================================================
const Standard_Boolean SelectMgr_BaseFrustum::IsClipped (const Graphic3d_SequenceOfHClipPlane& /*thePlanes*/,
const Standard_Real /*theDepth*/)
Standard_Boolean SelectMgr_BaseFrustum::IsClipped (const Graphic3d_SequenceOfHClipPlane& /*thePlanes*/,
const Standard_Real /*theDepth*/)
{
return Standard_True;
}

View File

@@ -89,49 +89,49 @@ public:
virtual NCollection_Handle<SelectMgr_BaseFrustum> Transform (const gp_Trsf& /*theTrsf*/) { return NULL; }
//! SAT intersection test between defined volume and given axis-aligned box
virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth);
virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth);
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt
virtual const Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt);
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt);
//! Intersection test between defined volume and given point
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth);
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth);
//! 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
virtual const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth);
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth);
//! Checks if line segment overlaps selecting frustum
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth);
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth);
//! 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
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth);
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth);
//! Measures distance between 3d projection of user-picked
//! screen point and given point theCOG
virtual const Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG);
virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG);
virtual SelectMgr_Vec3 DetectedPoint (const Standard_Real theDepth) const;
//! Checks if the point of sensitive in which selection was detected belongs
//! to the region defined by clipping planes
virtual const Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth);
virtual Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth);
protected:
Standard_Real myPixelTolerance; //!< Pixel tolerance

View File

@@ -63,25 +63,25 @@ protected:
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt
const Standard_Boolean hasOverlap (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt);
Standard_Boolean hasOverlap (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt);
//! SAT intersection test between defined volume and given point
const Standard_Boolean hasOverlap (const gp_Pnt& thePnt);
Standard_Boolean hasOverlap (const gp_Pnt& thePnt);
//! SAT intersection test between defined volume and given segment
const Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2);
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2);
//! SAT intersection test between frustum given and planar convex polygon represented as ordered point set
const Standard_Boolean hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
SelectMgr_Vec3& theNormal);
Standard_Boolean hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
SelectMgr_Vec3& theNormal);
//! SAT intersection test between defined volume and given triangle
const Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
SelectMgr_Vec3& theNormal);
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
SelectMgr_Vec3& theNormal);
private:

View File

@@ -121,8 +121,8 @@ Standard_Boolean SelectMgr_Frustum<N>::isSeparated (const gp_Pnt& thePnt1,
// theMinPnt and maximum at point theMaxPnt
// =======================================================================
template <int N>
const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
{
// E0 test
if (theMinPnt.x() > myMaxOrthoVertsProjections[0]
@@ -210,7 +210,7 @@ const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& t
// purpose : SAT intersection test between defined volume and given point
// =======================================================================
template <int N>
const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt)
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt)
{
SelectMgr_Vec3 aPnt (thePnt.X(), thePnt.Y(), thePnt.Z());
@@ -242,8 +242,8 @@ const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt)
// purpose : SAT intersection test between defined volume and given segment
// =======================================================================
template <int N>
const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
const gp_Pnt& theEndPnt)
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
const gp_Pnt& theEndPnt)
{
const SelectMgr_Vec3& aDir = SelectMgr_Vec3 (theEndPnt.X() - theStartPnt.X(),
theEndPnt.Y() - theStartPnt.Y(),
@@ -329,8 +329,8 @@ const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartP
// polygon represented as ordered point set
// =======================================================================
template <int N>
const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
SelectMgr_Vec3& theNormal)
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
SelectMgr_Vec3& theNormal)
{
Standard_Integer aStartIdx = theArrayOfPnts->Lower();
Standard_Integer anEndIdx = theArrayOfPnts->Upper();
@@ -427,10 +427,10 @@ const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const Handle(TColgp_HAr
// purpose : SAT intersection test between defined volume and given triangle
// =======================================================================
template <int N>
const Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
SelectMgr_Vec3& theNormal)
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
SelectMgr_Vec3& theNormal)
{
SelectMgr_Vec3 aPnt1 (thePnt1.X(), thePnt1.Y(), thePnt1.Z());

View File

@@ -517,8 +517,8 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_RectangularFrustum::Transfor
// axis-aligned bounding box with minimum corner at point
// theMinPnt and maximum at point theMaxPnt
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
{
return hasOverlap (theMinPnt, theMaxPnt);
}
@@ -528,8 +528,8 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_V
// purpose : SAT intersection test between defined volume and
// given axis-aligned box
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth)
{
const SelectMgr_Vec3& aMinPnt = theBox.CornerMin();
const SelectMgr_Vec3& aMaxPnt = theBox.CornerMax();
@@ -550,8 +550,8 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const BVH_Box<Sta
// function : Overlaps
// purpose : Intersection test between defined volume and given point
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth)
{
if (!hasOverlap (thePnt))
return Standard_False;
@@ -569,9 +569,9 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& the
// function : Overlaps
// purpose : Checks if line segment overlaps selecting frustum
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth)
{
theDepth = -DBL_MAX;
if (!hasOverlap (thePnt1, thePnt2))
@@ -588,9 +588,9 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& the
// may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
{
if (theSensType == Select3D_TOS_BOUNDARY)
{
@@ -638,11 +638,11 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const Handle(TCol
// boundary line defined by triangle vertices depending on
// given sensitivity type
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
{
if (theSensType == Select3D_TOS_BOUNDARY)
{
@@ -714,7 +714,7 @@ const Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& the
// purpose : Measures distance between 3d projection of user-picked
// screen point and given point theCOG
// =======================================================================
const Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt& theCOG)
Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt& theCOG)
{
const SelectMgr_Vec3& aCOG = SelectMgr_Vec3 (theCOG.X(), theCOG.Y(), theCOG.Z());
return DISTANCE (aCOG, myNearPickedPnt);
@@ -735,8 +735,8 @@ SelectMgr_Vec3 SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real
// purpose : Checks if the point of sensitive in which selection was
// detected belongs to the region defined by clipping planes
// =======================================================================
const Standard_Boolean SelectMgr_RectangularFrustum::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth)
Standard_Boolean SelectMgr_RectangularFrustum::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth)
{
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes);
Standard_Real aMaxDepth = DBL_MAX;

View File

@@ -49,50 +49,50 @@ public:
// SAT Tests for different objects
//! SAT intersection test between defined volume and given axis-aligned box
virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt) Standard_OVERRIDE;
//! Intersection test between defined volume and given point
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Measures distance between 3d projection of user-picked
//! screen point and given point theCOG
virtual const Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) Standard_OVERRIDE;
virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) Standard_OVERRIDE;
//! Calculates the point on a view ray that was detected during the run of selection algo by given depth
virtual SelectMgr_Vec3 DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;
//! Checks if the point of sensitive in which selection was detected belongs
//! to the region defined by clipping planes
virtual const Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth) Standard_OVERRIDE;
virtual Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real theDepth) Standard_OVERRIDE;
protected:

View File

@@ -132,7 +132,7 @@ const Handle(SelectMgr_SelectableObject)& SelectMgr_SelectableObjectSet::GetObje
// function : Contains
// purpose : Returns true if this objects set contains theObject given
//=======================================================================
const Standard_Boolean SelectMgr_SelectableObjectSet::Contains (const Handle(SelectMgr_SelectableObject)& theObject) const
Standard_Boolean SelectMgr_SelectableObjectSet::Contains (const Handle(SelectMgr_SelectableObject)& theObject) const
{
for (Standard_Integer anObjectIdx = 1; anObjectIdx <= myObjects.Size(); ++anObjectIdx)
{

View File

@@ -61,7 +61,7 @@ public:
const Handle(SelectMgr_SelectableObject)& GetObjectById (const Standard_Integer theIndex) const;
//! Returns true if this objects set contains theObject given
const Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const;
Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const;
private:

View File

@@ -52,7 +52,7 @@ SelectMgr_SelectingVolumeManager SelectMgr_SelectingVolumeManager::Transform (co
// function : GetActiveSelectionType
// purpose :
//=======================================================================
const Standard_Integer SelectMgr_SelectingVolumeManager::GetActiveSelectionType() const
Standard_Integer SelectMgr_SelectingVolumeManager::GetActiveSelectionType() const
{
return myActiveSelectionType;
}
@@ -177,8 +177,8 @@ void SelectMgr_SelectingVolumeManager::BuildSelectingVolume (const TColgp_Array1
// purpose : SAT intersection test between defined volume and
// given axis-aligned box
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -191,8 +191,8 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const BVH_Box
// function : Overlaps
// purpose : Intersection test between defined volume and given point
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -204,8 +204,8 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectM
// function : Overlaps
// purpose : Intersection test between defined volume and given point
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -221,9 +221,9 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt&
// may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -237,9 +237,9 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(
// function : Overlaps
// purpose : Checks if line segment overlaps selecting volume
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -254,11 +254,11 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt&
// boundary line defined by triangle vertices depending on
// given sensitivity type
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -275,7 +275,7 @@ const Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt&
// purpose : Measures distance between 3d projection of user-picked
// screen point and given point theCOG
//=======================================================================
const Standard_Real SelectMgr_SelectingVolumeManager::DistToGeometryCenter (const gp_Pnt& theCOG)
Standard_Real SelectMgr_SelectingVolumeManager::DistToGeometryCenter (const gp_Pnt& theCOG)
{
if (myActiveSelectionType == Unknown)
return Standard_False;
@@ -302,8 +302,8 @@ NCollection_Vec3<Standard_Real> SelectMgr_SelectingVolumeManager::DetectedPoint
// purpose : Checks if the point of sensitive in which selection was
// detected belongs to the region defined by clipping planes
//=======================================================================
const Standard_Boolean SelectMgr_SelectingVolumeManager::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real& theDepth)
Standard_Boolean SelectMgr_SelectingVolumeManager::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real& theDepth)
{
if (myActiveSelectionType == Point)
return Standard_False;

View File

@@ -40,7 +40,7 @@ public:
//! Returns a copy of active frustum transformed according to the matrix given
Standard_EXPORT virtual SelectMgr_SelectingVolumeManager Transform (const gp_Trsf& theTrsf);
Standard_EXPORT virtual const Standard_Integer GetActiveSelectionType() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Integer GetActiveSelectionType() const Standard_OVERRIDE;
Standard_EXPORT void SetActiveSelectionType (const SelectionType& theType);
@@ -77,43 +77,43 @@ public:
//! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBndBox,
Standard_Real& theDepth) 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 const Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt) Standard_OVERRIDE;
//! Intersection test between defined volume and given point
Standard_EXPORT virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) 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 const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) 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 const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Standard_Integer theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Measures distance between 3d projection of user-picked
//! screen point and given point theCOG
Standard_EXPORT virtual const Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) Standard_OVERRIDE;
//! Calculates the point on a view ray that was detected during the run of selection algo by given depth. Is valid for point
//! selection only
@@ -121,8 +121,8 @@ public:
//! Checks if the point of sensitive in which selection was detected belongs
//! to the region defined by clipping planes
Standard_EXPORT virtual const Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real& theDepth);
Standard_EXPORT virtual Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
const Standard_Real& theDepth);
private:
enum { Frustum, FrustumSet, VolumeTypesNb }; //!< Defines the amount of available selecting volumes

View File

@@ -45,7 +45,7 @@ void SelectMgr_Selection::Destroy()
{
for (Standard_Integer anEntityIdx = 0; anEntityIdx < myEntities.Size(); ++anEntityIdx)
{
SelectMgr_HSensitiveEntity& anEntity = myEntities.ChangeValue (anEntityIdx);
Handle(SelectMgr_SensitiveEntity)& anEntity = myEntities.ChangeValue (anEntityIdx);
anEntity->BaseSensitive()->Set (NULL);
}
mySensFactor = 2.0;
@@ -65,7 +65,7 @@ void SelectMgr_Selection::Add (const Handle(SelectBasics_SensitiveEntity)& theSe
// in release mode do not add
if (!theSensitive.IsNull())
{
SelectMgr_HSensitiveEntity anEntity = new SelectMgr_SensitiveEntity (theSensitive);
Handle(SelectMgr_SensitiveEntity) anEntity = new SelectMgr_SensitiveEntity (theSensitive);
myEntities.Append (anEntity);
if (mySelectionState == SelectMgr_SOS_Activated &&
!anEntity->IsActiveForSelection())
@@ -86,7 +86,7 @@ void SelectMgr_Selection::Clear()
{
for (Standard_Integer anIdx = 0; anIdx < myEntities.Size(); ++anIdx)
{
SelectMgr_HSensitiveEntity& anEntity = myEntities.ChangeValue (anIdx);
Handle(SelectMgr_SensitiveEntity)& anEntity = myEntities.ChangeValue (anIdx);
anEntity->Clear();
}
@@ -107,7 +107,7 @@ Standard_Boolean SelectMgr_Selection::IsEmpty() const
// purpose : Returns sensitive entity stored by
// index theIdx in entites vector
//==================================================
SelectMgr_HSensitiveEntity& SelectMgr_Selection::GetEntityById (const Standard_Integer theIdx)
Handle(SelectMgr_SensitiveEntity)& SelectMgr_Selection::GetEntityById (const Standard_Integer theIdx)
{
return myEntities.ChangeValue (theIdx);
}
@@ -134,7 +134,7 @@ void SelectMgr_Selection::SetSelectionState (const SelectMgr_StateOfSelection th
// function: Sensitivity
// purpose : Returns sensitivity of the selection
//==================================================
const Standard_Real SelectMgr_Selection::Sensitivity() const
Standard_Real SelectMgr_Selection::Sensitivity() const
{
return mySensFactor;
}

View File

@@ -17,7 +17,6 @@
#ifndef _SelectMgr_Selection_HeaderFile
#define _SelectMgr_Selection_HeaderFile
#include <NCollection_Handle.hxx>
#include <NCollection_Vector.hxx>
#include <Standard.hxx>
@@ -34,8 +33,6 @@
class Standard_NullObject;
class SelectBasics_SensitiveEntity;
typedef NCollection_Handle<SelectMgr_SensitiveEntity> SelectMgr_HSensitiveEntity;
//! Represents the state of a given selection mode for a
//! Selectable Object. Contains all the sensitive entities available for this mode.
//! An interactive object can have an indefinite number of
@@ -111,7 +108,7 @@ public:
void Next();
//! Returns any sensitive primitive in this framework.
const SelectMgr_HSensitiveEntity& Sensitive() const;
const Handle(SelectMgr_SensitiveEntity)& Sensitive() const;
//! Returns the flag UpdateFlag.
//! This flage gives the update status of this framework
@@ -134,24 +131,24 @@ public:
Standard_EXPORT void SetSelectionState (const SelectMgr_StateOfSelection theState) const;
//! Returns sensitivity of the selection
Standard_EXPORT const Standard_Real Sensitivity() const;
Standard_EXPORT Standard_Real Sensitivity() const;
DEFINE_STANDARD_RTTI (SelectMgr_Selection)
protected:
//! Returns sensitive entity stored by index theIdx in entites vector
SelectMgr_HSensitiveEntity& GetEntityById (const Standard_Integer theIdx);
Handle(SelectMgr_SensitiveEntity)& GetEntityById (const Standard_Integer theIdx);
private:
NCollection_Vector<SelectMgr_HSensitiveEntity> myEntities;
NCollection_Vector<SelectMgr_HSensitiveEntity>::Iterator myEntityIter;
Standard_Integer myMode;
SelectMgr_TypeOfUpdate myUpdateStatus;
mutable SelectMgr_StateOfSelection mySelectionState;
mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus;
Standard_Real mySensFactor;
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> myEntities;
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator myEntityIter;
Standard_Integer myMode;
SelectMgr_TypeOfUpdate myUpdateStatus;
mutable SelectMgr_StateOfSelection mySelectionState;
mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus;
Standard_Real mySensFactor;
};
DEFINE_STANDARD_HANDLE(SelectMgr_Selection, MMgt_TShared)

View File

@@ -52,7 +52,7 @@ inline void SelectMgr_Selection::Next()
// function : Sensitive
// purpose :
// =======================================================================
inline const SelectMgr_HSensitiveEntity& SelectMgr_Selection::Sensitive() const
inline const Handle(SelectMgr_SensitiveEntity)& SelectMgr_Selection::Sensitive() const
{
return myEntityIter.Value();
}

View File

@@ -15,6 +15,9 @@
#include <SelectMgr_SensitiveEntity.hxx>
IMPLEMENT_STANDARD_HANDLE (SelectMgr_SensitiveEntity, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_SensitiveEntity, Standard_Transient)
//=======================================================================
// function : SelectMgr_SensitiveEntity
// purpose : Creates new inactive for selection object with base entity
@@ -50,7 +53,7 @@ const Handle(SelectBasics_SensitiveEntity)& SelectMgr_SensitiveEntity::BaseSensi
// purpose : Returns true if this entity belongs to the active selection
// mode of parent object
//=======================================================================
const Standard_Boolean SelectMgr_SensitiveEntity::IsActiveForSelection() const
Standard_Boolean SelectMgr_SensitiveEntity::IsActiveForSelection() const
{
return myIsActiveForSelection;
}

View File

@@ -18,10 +18,12 @@
#include <SelectBasics_SensitiveEntity.hxx>
#include <Handle_SelectBasics_SensitiveEntity.hxx>
#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
//! The purpose of this class is to mark sensitive entities selectable or not
//! depending on current active selection of parent object for proper BVH traverse
class SelectMgr_SensitiveEntity
class SelectMgr_SensitiveEntity : public Standard_Transient
{
public:
@@ -38,7 +40,7 @@ public:
//! Returns true if this entity belongs to the active selection
//! mode of parent object
const Standard_Boolean IsActiveForSelection() const;
Standard_Boolean IsActiveForSelection() const;
//! Marks entity as inactive for selection
Standard_EXPORT void ResetSelectionActiveStatus() const;
@@ -46,10 +48,14 @@ public:
//! Marks entity as active for selection
Standard_EXPORT void SetActiveForSelection() const;
DEFINE_STANDARD_RTTI(SelectMgr_SensitiveEntity) // Type definition
private:
Handle(SelectBasics_SensitiveEntity) mySensitive; //!< Related SelectBasics entity
mutable Standard_Boolean myIsActiveForSelection; //!< Selection activity status
mutable Standard_Boolean myIsActiveForSelection; //!< Selection activity status
};
DEFINE_STANDARD_HANDLE(SelectMgr_SensitiveEntity, Standard_Transient)
#endif // _SelectMgr_SensitiveEntity_HeaderFile

View File

@@ -33,7 +33,7 @@ SelectMgr_SensitiveEntitySet::SelectMgr_SensitiveEntitySet()
// function : Append
// purpose : Adds new entity to the set and marks BVH tree for rebuild
//=======================================================================
void SelectMgr_SensitiveEntitySet::Append (const SelectMgr_HSensitiveEntity& theEntity)
void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_SensitiveEntity)& theEntity)
{
if (!theEntity->BaseSensitive()->IsKind ("Select3D_SensitiveEntity"))
{
@@ -69,7 +69,7 @@ void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_Selection)& th
// function : Remove
// purpose : Removes entity from the set and marks BVH tree for rebuild
//=======================================================================
void SelectMgr_SensitiveEntitySet::Remove (const SelectMgr_HSensitiveEntity& theEntity)
void SelectMgr_SensitiveEntitySet::Remove (const Handle(SelectMgr_SensitiveEntity)& theEntity)
{
for (Standard_Integer anEntityIdx = 1; anEntityIdx <= myEntities.Size(); ++anEntityIdx)
{
@@ -173,7 +173,7 @@ Standard_Integer SelectMgr_SensitiveEntitySet::Size() const
// function : GetSensitiveById
// purpose : Returns the entity with index theIndex in the set
//=======================================================================
const SelectMgr_HSensitiveEntity& SelectMgr_SensitiveEntitySet::GetSensitiveById
const Handle(SelectMgr_SensitiveEntity)& SelectMgr_SensitiveEntitySet::GetSensitiveById
(const Standard_Integer theIndex) const
{
Standard_Integer anIdx = myEntityIdxs.Value (theIndex + 1);

View File

@@ -38,14 +38,14 @@ public:
virtual ~SelectMgr_SensitiveEntitySet() {};
//! Adds new entity to the set and marks BVH tree for rebuild
void Append (const SelectMgr_HSensitiveEntity& theEntity);
void Append (const Handle(SelectMgr_SensitiveEntity)& theEntity);
//! Adds every entity of selection theSelection to the set and marks
//! BVH tree for rebuild
void Append (const Handle(SelectMgr_Selection)& theSelection);
//! Removes entity from the set and marks BVH tree for rebuild
void Remove (const SelectMgr_HSensitiveEntity& theEntity);
void Remove (const Handle(SelectMgr_SensitiveEntity)& theEntity);
//! Removes every entity of selection theSelection from the set
//! and marks BVH tree for rebuild
@@ -67,12 +67,12 @@ public:
virtual Standard_Integer Size() const Standard_OVERRIDE;
//! Returns the entity with index theIndex in the set
const SelectMgr_HSensitiveEntity& GetSensitiveById (const Standard_Integer theIndex) const;
const Handle(SelectMgr_SensitiveEntity)& GetSensitiveById (const Standard_Integer theIndex) const;
private:
NCollection_Sequence<SelectMgr_HSensitiveEntity> myEntities; //!< A sequence of calculated sensitives of the object
NCollection_Sequence<Standard_Integer> myEntityIdxs; //!< Cached indexes for faster BVH build
NCollection_Sequence<Handle(SelectMgr_SensitiveEntity)> myEntities; //!< A sequence of calculated sensitives of the object
NCollection_Sequence<Standard_Integer> myEntityIdxs; //!< Cached indexes for faster BVH build
};
#endif // _SelectMgr_SensitiveEntitySet_HeaderFile

View File

@@ -225,8 +225,8 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_TriangularFrustum::Transform
// purpose : SAT intersection test between defined volume and
// given axis-aligned box
//=======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& /*theDepth*/)
{
return hasOverlap (theBox.CornerMin(), theBox.CornerMax());
}
@@ -237,8 +237,8 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box<Stan
// axis-aligned bounding box with minimum corner at point
// theMinPt and maximum at point theMaxPt
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt)
{
return hasOverlap (theMinPt, theMaxPt);
}
@@ -247,8 +247,8 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Ve
// function : Overlaps
// purpose : Intersection test between defined volume and given point
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt,
Standard_Real& /*theDepth*/)
{
return hasOverlap (thePnt);
}
@@ -260,9 +260,9 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& theP
// may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& /*theDepth*/)
{
if (theSensType == Select3D_TOS_BOUNDARY)
{
@@ -293,9 +293,9 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const Handle(TColg
// function : Overlaps
// purpose : Checks if line segment overlaps selecting frustum
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& /*theDepth*/)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& /*theDepth*/)
{
return hasOverlap (thePnt1, thePnt2);
}
@@ -307,11 +307,11 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& theP
// boundary line defined by triangle vertices depending on
// given sensitivity type
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
{
if (theSensType == Select3D_TOS_BOUNDARY)
{

View File

@@ -45,38 +45,38 @@ public:
// SAT Tests for different objects
//! SAT intersection test between defined volume and given axis-aligned box
virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt) Standard_OVERRIDE;
//! Intersection test between defined volume and given point
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth) 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
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
//! Nullifies the handle to corresponding builder instance to prevent memory leaks
void Clear();

View File

@@ -122,8 +122,8 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_TriangularFrustumSet::Transf
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{
@@ -138,8 +138,8 @@ const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const BVH_Box<S
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{
@@ -154,8 +154,8 @@ const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
Standard_Real& theDepth)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{
@@ -170,9 +170,9 @@ const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& t
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{
@@ -187,9 +187,9 @@ const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const Handle(TC
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
Standard_Real& theDepth)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{
@@ -204,11 +204,11 @@ const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& t
// function : Overlaps
// purpose :
// =======================================================================
const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth)
{
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{

View File

@@ -50,28 +50,28 @@ public:
//! Returns a copy of the frustum with all sub-volumes transformed according to the matrix given
virtual NCollection_Handle<SelectMgr_BaseFrustum> Transform (const gp_Trsf& theTrsf) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const BVH_Box<Standard_Real, 3>& theBox,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual const Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1,
const gp_Pnt& thePt2,
const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType,
Standard_Real& theDepth) Standard_OVERRIDE;
private:

View File

@@ -117,7 +117,7 @@ void SelectMgr_ToleranceMap::Decrement (const Standard_Real& theTolerance)
}
}
const Standard_Real SelectMgr_ToleranceMap::Largest()
Standard_Real SelectMgr_ToleranceMap::Largest()
{
return myLargestKey;
}
@@ -302,7 +302,7 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
Standard_Integer anEndIdx = aSensitivesTree->EndPrimitive (aNode);
for (Standard_Integer anIdx = aStartIdx; anIdx <= anEndIdx; ++anIdx)
{
const SelectMgr_HSensitiveEntity& aSensitive =
const Handle(SelectMgr_SensitiveEntity)& aSensitive =
anEntitySet->GetSensitiveById (anIdx);
if (aSensitive->IsActiveForSelection())
{

View File

@@ -69,7 +69,7 @@ public:
Standard_EXPORT void Decrement (const Standard_Real& theTolerance);
Standard_EXPORT const Standard_Real Largest();
Standard_EXPORT Standard_Real Largest();
private:
NCollection_DataMap<Standard_Real, Standard_Integer> myTolerances;