1 // Created on: 1998-03-26
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _SelectMgr_SortCriterion_HeaderFile
18 #define _SelectMgr_SortCriterion_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
29 //! This class provides data and criterion for sorting candidate
30 //! entities in the process of interactive selection by mouse click
31 class SelectMgr_SortCriterion
38 Standard_EXPORT SelectMgr_SortCriterion();
40 //! Defines parameters of selection criterion:
41 //! - Priority: selection priority
42 //! - Depth: distance from the view plane to the entity
43 //! - MinDist: distance from the clicked point to the entity on the view plane
44 //! - Tol: tolerance used for selecting candidates
45 //! - PreferClosest: specify whether closest object is preferred even if
46 //! if has less priority
47 Standard_EXPORT SelectMgr_SortCriterion(const Standard_Integer thePriority, const Standard_Real theDepth, const Standard_Real theMinDist, const Standard_Real theTol, const Standard_Boolean PreferClosest);
49 void SetPriority (const Standard_Integer P);
51 void SetDepth (const Standard_Real D);
53 void SetMinDist (const Standard_Real D);
55 void SetTol (const Standard_Real T);
57 Standard_Integer Priority() const;
59 Standard_Real Depth() const;
61 Standard_Real MinDist() const;
63 Standard_Real Tol() const;
65 Standard_EXPORT Standard_Boolean IsGreater (const SelectMgr_SortCriterion& anOtherCriterion) const;
66 Standard_Boolean operator > (const SelectMgr_SortCriterion& anOtherCriterion) const
68 return IsGreater(anOtherCriterion);
71 Standard_EXPORT Standard_Boolean IsLower (const SelectMgr_SortCriterion& anOtherCriterion) const;
72 Standard_Boolean operator < (const SelectMgr_SortCriterion& anOtherCriterion) const
74 return IsLower(anOtherCriterion);
90 Standard_Integer myPrior;
91 Standard_Real myDepth;
94 Standard_Boolean myPreferClosest;
100 #include <SelectMgr_SortCriterion.lxx>
106 #endif // _SelectMgr_SortCriterion_HeaderFile