0024739: TKOpenGl - port ray-tracing from OpenCL to GLSL for better integration and...
[occt.git] / src / BVH / BVH_Object.hxx
1 // Created on: 2013-12-20
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013-2014 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_Object_Header
17 #define _BVH_Object_Header
18
19 #include <BVH_Box.hxx>
20 #include <BVH_Properties.hxx>
21
22 #include <NCollection_Handle.hxx>
23
24 //! Abstract geometric object.
25 template<class T, int N>
26 class BVH_Object
27 {
28 public:
29
30   //! Creates new abstract geometric object.
31   BVH_Object();
32
33   //! Releases resources of geometric object.
34   virtual ~BVH_Object() = 0;
35
36 public:
37
38   //! Returns AABB of geometric object.
39   virtual BVH_Box<T, N> Box() const = 0;
40
41   //! Returns properties of geometric object.
42   virtual const NCollection_Handle<BVH_Properties>& Properties() const;
43
44   //! Sets properties of geometric object.
45   virtual void SetProperties (const NCollection_Handle<BVH_Properties>& theProperties);
46
47   //! Marks object state as outdated.
48   virtual void MarkDirty();
49
50 protected:
51
52   Standard_Boolean                   myIsDirty;    //!< Marks that internal object state need to be updated
53   NCollection_Handle<BVH_Properties> myProperties; //!< Generic properties assigned to the object
54
55 };
56
57 #include <BVH_Object.lxx>
58
59 #endif // _BVH_Object_Header