Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:19

0001 // Created on: 2014-01-10
0002 // Created by: Denis BOGOLEPOV
0003 // Copyright (c) 2013-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef BVH_Sorter_HeaderFile
0017 #define BVH_Sorter_HeaderFile
0018 
0019 #include <BVH_Set.hxx>
0020 
0021 //! Tool object to sort abstract primitive set.
0022 template<class T, int N>
0023 class BVH_Sorter
0024 {
0025 public:
0026 
0027   //! Performs default initialization.
0028   BVH_Sorter()
0029   : myIsParallel (Standard_False)
0030   { }
0031 
0032   //! Releases resources of BVH sorter.
0033   virtual ~BVH_Sorter() { }
0034 
0035   //! Sorts the set.
0036   virtual void Perform (BVH_Set<T, N>* theSet) = 0;
0037 
0038   //! Sorts the given (inclusive) range in the set.
0039   virtual void Perform (BVH_Set<T, N>* theSet, const Standard_Integer theStart, const Standard_Integer theFinal) = 0;
0040 
0041   //! Returns parallel flag.
0042   inline Standard_Boolean IsParallel() const
0043   {
0044     return myIsParallel;
0045   }
0046 
0047   //! Set parallel flag contolling possibility of parallel execution.
0048   inline void SetParallel(const Standard_Boolean isParallel)
0049   {
0050     myIsParallel = isParallel;
0051   }
0052 
0053 private:
0054 
0055   Standard_Boolean myIsParallel;
0056 };
0057 
0058 #endif // _BVH_Sorter_Header