1 // Created on: 2013-12-20
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BVH_Object_Header
17 #define _BVH_Object_Header
19 #include <BVH_Box.hxx>
20 #include <BVH_Properties.hxx>
22 //! A non-template class for using as base for BVH_Object
23 //! (just to have a named base class).
24 class BVH_ObjectTransient : public Standard_Transient
26 DEFINE_STANDARD_RTTIEXT(BVH_ObjectTransient, Standard_Transient)
29 //! Returns properties of the geometric object.
30 virtual const Handle(BVH_Properties)& Properties() const { return myProperties; }
32 //! Sets properties of the geometric object.
33 virtual void SetProperties (const Handle(BVH_Properties)& theProperties) { myProperties = theProperties; }
35 //! Returns TRUE if object state should be updated.
36 virtual Standard_Boolean IsDirty() const { return myIsDirty; }
38 //! Marks object state as outdated (needs BVH rebuilding).
39 virtual void MarkDirty() { myIsDirty = Standard_True; }
43 //! Creates new abstract geometric object.
44 BVH_ObjectTransient() : myIsDirty (Standard_False) {}
48 Standard_Boolean myIsDirty; //!< Marks internal object state as outdated
49 Handle(BVH_Properties) myProperties; //!< Generic properties assigned to the object
53 //! Abstract geometric object bounded by BVH box.
54 //! \tparam T Numeric data type
55 //! \tparam N Vector dimension
56 template<class T, int N>
57 class BVH_Object : public BVH_ObjectTransient
61 //! Creates new abstract geometric object.
64 //! Releases resources of geometric object.
65 virtual ~BVH_Object() = 0;
69 //! Returns AABB of the geometric object.
70 virtual BVH_Box<T, N> Box() const = 0;
74 // =======================================================================
75 // function : ~BVH_Object
77 // =======================================================================
78 template<class T, int N>
79 BVH_Object<T, N>::~BVH_Object()
84 #endif // _BVH_Object_Header