From 7ab159522a823eb07b206617e055a10e399934de Mon Sep 17 00:00:00 2001 From: vpa Date: Thu, 23 Apr 2015 01:12:55 +0300 Subject: [PATCH] 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. --- src/SelectBasics/SelectBasics_PickResult.hxx | 4 +- .../SelectBasics_SelectingVolumeManager.hxx | 38 ++++++++--------- src/SelectMgr/SelectMgr_BaseFrustum.cxx | 40 +++++++++--------- src/SelectMgr/SelectMgr_BaseFrustum.hxx | 40 +++++++++--------- src/SelectMgr/SelectMgr_Frustum.hxx | 22 +++++----- src/SelectMgr/SelectMgr_Frustum.lxx | 22 +++++----- .../SelectMgr_RectangularFrustum.cxx | 40 +++++++++--------- .../SelectMgr_RectangularFrustum.hxx | 40 +++++++++--------- .../SelectMgr_SelectableObjectSet.cxx | 2 +- .../SelectMgr_SelectableObjectSet.hxx | 2 +- .../SelectMgr_SelectingVolumeManager.cxx | 42 +++++++++---------- .../SelectMgr_SelectingVolumeManager.hxx | 42 +++++++++---------- src/SelectMgr/SelectMgr_Selection.cxx | 10 ++--- src/SelectMgr/SelectMgr_Selection.hxx | 23 +++++----- src/SelectMgr/SelectMgr_Selection.lxx | 2 +- src/SelectMgr/SelectMgr_SensitiveEntity.cxx | 5 ++- src/SelectMgr/SelectMgr_SensitiveEntity.hxx | 12 ++++-- .../SelectMgr_SensitiveEntitySet.cxx | 6 +-- .../SelectMgr_SensitiveEntitySet.hxx | 10 ++--- src/SelectMgr/SelectMgr_TriangularFrustum.cxx | 34 +++++++-------- src/SelectMgr/SelectMgr_TriangularFrustum.hxx | 34 +++++++-------- .../SelectMgr_TriangularFrustumSet.cxx | 34 +++++++-------- .../SelectMgr_TriangularFrustumSet.hxx | 34 +++++++-------- src/SelectMgr/SelectMgr_ViewerSelector.cxx | 4 +- src/SelectMgr/SelectMgr_ViewerSelector.hxx | 2 +- 25 files changed, 275 insertions(+), 269 deletions(-) diff --git a/src/SelectBasics/SelectBasics_PickResult.hxx b/src/SelectBasics/SelectBasics_PickResult.hxx index 9088525de2..bf72fab9b0 100644 --- a/src/SelectBasics/SelectBasics_PickResult.hxx +++ b/src/SelectBasics/SelectBasics_PickResult.hxx @@ -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; } diff --git a/src/SelectBasics/SelectBasics_SelectingVolumeManager.hxx b/src/SelectBasics/SelectBasics_SelectingVolumeManager.hxx index 0596813bfd..02a349cc5f 100644 --- a/src/SelectBasics/SelectBasics_SelectingVolumeManager.hxx +++ b/src/SelectBasics/SelectBasics_SelectingVolumeManager.hxx @@ -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& theBox, - Standard_Real& theDepth) = 0; + virtual Standard_Boolean Overlaps (const BVH_Box& 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& theMinPt, - const NCollection_Vec3& theMaxPt) = 0; + virtual Standard_Boolean Overlaps (const NCollection_Vec3& theMinPt, + const NCollection_Vec3& 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 DetectedPoint (const Standard_Real theDepth) const = 0; diff --git a/src/SelectMgr/SelectMgr_BaseFrustum.cxx b/src/SelectMgr/SelectMgr_BaseFrustum.cxx index cf64c83661..4d615bfe29 100644 --- a/src/SelectMgr/SelectMgr_BaseFrustum.cxx +++ b/src/SelectMgr/SelectMgr_BaseFrustum.cxx @@ -97,8 +97,8 @@ void SelectMgr_BaseFrustum::SetBuilder (const NCollection_Handle& /*theBndBox*/, - Standard_Real& /*theDepth*/) +Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const BVH_Box& /*theBndBox*/, + Standard_Real& /*theDepth*/) { return Standard_False; } @@ -107,8 +107,8 @@ const Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const BVH_Box 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& theBndBox, - Standard_Real& theDepth); + virtual Standard_Boolean Overlaps (const BVH_Box& 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 diff --git a/src/SelectMgr/SelectMgr_Frustum.hxx b/src/SelectMgr/SelectMgr_Frustum.hxx index 84f42907de..01eaab3672 100644 --- a/src/SelectMgr/SelectMgr_Frustum.hxx +++ b/src/SelectMgr/SelectMgr_Frustum.hxx @@ -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: diff --git a/src/SelectMgr/SelectMgr_Frustum.lxx b/src/SelectMgr/SelectMgr_Frustum.lxx index 5480089f0b..4c8b22ae71 100644 --- a/src/SelectMgr/SelectMgr_Frustum.lxx +++ b/src/SelectMgr/SelectMgr_Frustum.lxx @@ -121,8 +121,8 @@ Standard_Boolean SelectMgr_Frustum::isSeparated (const gp_Pnt& thePnt1, // theMinPnt and maximum at point theMaxPnt // ======================================================================= template -const Standard_Boolean SelectMgr_Frustum::hasOverlap (const SelectMgr_Vec3& theMinPnt, - const SelectMgr_Vec3& theMaxPnt) +Standard_Boolean SelectMgr_Frustum::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::hasOverlap (const SelectMgr_Vec3& t // purpose : SAT intersection test between defined volume and given point // ======================================================================= template -const Standard_Boolean SelectMgr_Frustum::hasOverlap (const gp_Pnt& thePnt) +Standard_Boolean SelectMgr_Frustum::hasOverlap (const gp_Pnt& thePnt) { SelectMgr_Vec3 aPnt (thePnt.X(), thePnt.Y(), thePnt.Z()); @@ -242,8 +242,8 @@ const Standard_Boolean SelectMgr_Frustum::hasOverlap (const gp_Pnt& thePnt) // purpose : SAT intersection test between defined volume and given segment // ======================================================================= template -const Standard_Boolean SelectMgr_Frustum::hasOverlap (const gp_Pnt& theStartPnt, - const gp_Pnt& theEndPnt) +Standard_Boolean SelectMgr_Frustum::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::hasOverlap (const gp_Pnt& theStartP // polygon represented as ordered point set // ======================================================================= template -const Standard_Boolean SelectMgr_Frustum::hasOverlap (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts, - SelectMgr_Vec3& theNormal) +Standard_Boolean SelectMgr_Frustum::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::hasOverlap (const Handle(TColgp_HAr // purpose : SAT intersection test between defined volume and given triangle // ======================================================================= template -const Standard_Boolean SelectMgr_Frustum::hasOverlap (const gp_Pnt& thePnt1, - const gp_Pnt& thePnt2, - const gp_Pnt& thePnt3, - SelectMgr_Vec3& theNormal) +Standard_Boolean SelectMgr_Frustum::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()); diff --git a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx index a59892e30c..3646f50dc2 100644 --- a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -517,8 +517,8 @@ NCollection_Handle 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& theBox, - Standard_Real& theDepth) +Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const BVH_Box& 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& theBox, - Standard_Real& theDepth) Standard_OVERRIDE; + virtual Standard_Boolean Overlaps (const BVH_Box& 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: diff --git a/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx b/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx index 014fdbde95..4c5738c103 100644 --- a/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx +++ b/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx @@ -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) { diff --git a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx index 59ac5a4296..26324394a2 100644 --- a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx +++ b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx @@ -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: diff --git a/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx b/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx index 6e5b483576..c136cfd14d 100644 --- a/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx +++ b/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx @@ -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& theBndBox, - Standard_Real& theDepth) +Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const BVH_Box& 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 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; diff --git a/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx b/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx index 2d0eb27664..d811ca25f8 100644 --- a/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx +++ b/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx @@ -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& theBndBox, - Standard_Real& theDepth) Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean Overlaps (const BVH_Box& 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 diff --git a/src/SelectMgr/SelectMgr_Selection.cxx b/src/SelectMgr/SelectMgr_Selection.cxx index 2ca550259e..ad5e55eaa8 100644 --- a/src/SelectMgr/SelectMgr_Selection.cxx +++ b/src/SelectMgr/SelectMgr_Selection.cxx @@ -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; } diff --git a/src/SelectMgr/SelectMgr_Selection.hxx b/src/SelectMgr/SelectMgr_Selection.hxx index cf0b79cfb2..8a2c0b4eda 100644 --- a/src/SelectMgr/SelectMgr_Selection.hxx +++ b/src/SelectMgr/SelectMgr_Selection.hxx @@ -17,7 +17,6 @@ #ifndef _SelectMgr_Selection_HeaderFile #define _SelectMgr_Selection_HeaderFile -#include #include #include @@ -34,8 +33,6 @@ class Standard_NullObject; class SelectBasics_SensitiveEntity; -typedef NCollection_Handle 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 myEntities; - NCollection_Vector::Iterator myEntityIter; - Standard_Integer myMode; - SelectMgr_TypeOfUpdate myUpdateStatus; - mutable SelectMgr_StateOfSelection mySelectionState; - mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus; - Standard_Real mySensFactor; + NCollection_Vector myEntities; + NCollection_Vector::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) diff --git a/src/SelectMgr/SelectMgr_Selection.lxx b/src/SelectMgr/SelectMgr_Selection.lxx index 60ed4db5af..5b030709c0 100644 --- a/src/SelectMgr/SelectMgr_Selection.lxx +++ b/src/SelectMgr/SelectMgr_Selection.lxx @@ -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(); } diff --git a/src/SelectMgr/SelectMgr_SensitiveEntity.cxx b/src/SelectMgr/SelectMgr_SensitiveEntity.cxx index 5d515ed981..cb054b8fea 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntity.cxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntity.cxx @@ -15,6 +15,9 @@ #include +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; } diff --git a/src/SelectMgr/SelectMgr_SensitiveEntity.hxx b/src/SelectMgr/SelectMgr_SensitiveEntity.hxx index 71787a0f69..1ef1efce87 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntity.hxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntity.hxx @@ -18,10 +18,12 @@ #include #include +#include +#include //! 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 diff --git a/src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx b/src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx index e2a591af78..c3c4d5d253 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntitySet.cxx @@ -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); diff --git a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx index c143bb94cb..e51144025a 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx @@ -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 myEntities; //!< A sequence of calculated sensitives of the object - NCollection_Sequence myEntityIdxs; //!< Cached indexes for faster BVH build + NCollection_Sequence myEntities; //!< A sequence of calculated sensitives of the object + NCollection_Sequence myEntityIdxs; //!< Cached indexes for faster BVH build }; #endif // _SelectMgr_SensitiveEntitySet_HeaderFile diff --git a/src/SelectMgr/SelectMgr_TriangularFrustum.cxx b/src/SelectMgr/SelectMgr_TriangularFrustum.cxx index 715d1a8e7c..9d27b01e44 100644 --- a/src/SelectMgr/SelectMgr_TriangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_TriangularFrustum.cxx @@ -225,8 +225,8 @@ NCollection_Handle SelectMgr_TriangularFrustum::Transform // purpose : SAT intersection test between defined volume and // given axis-aligned box //======================================================================= -const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box& theBox, - Standard_Real& /*theDepth*/) +Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box& theBox, + Standard_Real& /*theDepth*/) { return hasOverlap (theBox.CornerMin(), theBox.CornerMax()); } @@ -237,8 +237,8 @@ const Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const BVH_Box& theBox, - Standard_Real& theDepth) Standard_OVERRIDE; + virtual Standard_Boolean Overlaps (const BVH_Box& 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(); diff --git a/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index fd9c2f6291..0848cc1bad 100644 --- a/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -122,8 +122,8 @@ NCollection_Handle SelectMgr_TriangularFrustumSet::Transf // function : Overlaps // purpose : // ======================================================================= -const Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const BVH_Box& theBox, - Standard_Real& theDepth) +Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const BVH_Box& 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 Transform (const gp_Trsf& theTrsf) Standard_OVERRIDE; - virtual const Standard_Boolean Overlaps (const BVH_Box& theBox, - Standard_Real& theDepth) Standard_OVERRIDE; + virtual Standard_Boolean Overlaps (const BVH_Box& 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: diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 9190f3bf45..a2d82dc953 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -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()) { diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.hxx b/src/SelectMgr/SelectMgr_ViewerSelector.hxx index ed28c9f874..5df7321793 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.hxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.hxx @@ -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 myTolerances; -- 2.39.5