3a507ddb |
1 | // Created on: 2016-04-13 |
2 | // Created by: Denis BOGOLEPOV |
3 | // Copyright (c) 2013-2016 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _BVH_QuickSorter_Header |
17 | #define _BVH_QuickSorter_Header |
18 | |
19 | #include <BVH_Sorter.hxx> |
20 | |
21 | //! Performs centroid-based sorting of abstract set along |
22 | //! the given axis (X - 0, Y - 1, Z - 2) using quick sort. |
23 | template<class T, int N> |
24 | class BVH_QuickSorter : public BVH_Sorter<T, N> |
25 | { |
26 | public: |
27 | |
28 | //! Creates new BVH quick sorter for the given axis. |
29 | BVH_QuickSorter (const Standard_Integer theAxis = 0) : myAxis (theAxis) { } |
30 | |
31 | //! Sorts the set. |
32 | virtual void Perform (BVH_Set<T, N>* theSet); |
33 | |
34 | //! Sorts the given (inclusive) range in the set. |
35 | virtual void Perform (BVH_Set<T, N>* theSet, const Standard_Integer theStart, const Standard_Integer theFinal); |
36 | |
37 | protected: |
38 | |
39 | //! Axis used to arrange the primitives (X - 0, Y - 1, Z - 2). |
40 | Standard_Integer myAxis; |
41 | |
42 | }; |
43 | |
44 | #include <BVH_QuickSorter.lxx> |
45 | |
46 | #endif // _BVH_QuickSorter_Header |