1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 //=======================================================================
16 // function: Tolerance
17 // purpose : Returns a current tolerance that must be applied
18 //=======================================================================
19 inline Standard_Real SelectMgr_ToleranceMap::Tolerance() const
21 if (myLargestKey < Precision::Confusion())
22 return 2.0; // default tolerance value
24 return myCustomTolerance < 0.0 ? myLargestKey : myLargestKey + myCustomTolerance;
27 //=======================================================================
28 // function: SetCustomTolerance
29 // purpose : Sets tolerance to the given one and disables adaptive checks
30 //=======================================================================
31 inline void SelectMgr_ToleranceMap::SetCustomTolerance (const Standard_Real theTolerance)
33 myCustomTolerance = theTolerance;
36 //=======================================================================
37 // function: CustomTolerance
38 // purpose : Returns current value of custom tolerance regardless of it is set or not
39 //=======================================================================
40 inline Standard_Real SelectMgr_ToleranceMap::CustomTolerance() const
42 return myCustomTolerance;
45 //=======================================================================
46 // function: IsCustomTolSet
47 // purpose : Checks if custom tolerance value is greater than zero
48 //=======================================================================
49 inline Standard_Boolean SelectMgr_ToleranceMap::IsCustomTolSet() const
51 return myCustomTolerance > 0.0;
54 //=======================================================================
55 // function: ResetDefaults
56 // purpose : Unsets a custom tolerance and enables adaptive checks
57 //=======================================================================
58 inline void SelectMgr_ToleranceMap::ResetDefaults()
60 myCustomTolerance = -1.0;
63 inline Standard_Real SelectMgr_ViewerSelector::Sensitivity() const
65 return myTolerances.Tolerance();
68 inline void SelectMgr_ViewerSelector::Init()
73 inline void SelectMgr_ViewerSelector::Next()
78 inline void SelectMgr_ViewerSelector::SetPickClosest (const Standard_Boolean preferClosest)
80 preferclosest = preferClosest;
83 inline void SelectMgr_ViewerSelector::InitDetected()
85 myDetectedIter.Initialize (myMapOfDetected);
88 inline void SelectMgr_ViewerSelector::NextDetected()
90 myDetectedIter.Next();
93 inline Standard_Boolean SelectMgr_ViewerSelector::MoreDetected()
95 return myDetectedIter.More();
98 inline SelectMgr_SelectingVolumeManager& SelectMgr_ViewerSelector::GetManager()
100 return mySelectingVolumeMgr;