3c4e78f2 |
1 | // Created on: 2013-12-20 |
2 | // Created by: Denis BOGOLEPOV |
d5f74e42 |
3 | // Copyright (c) 2013-2014 OPEN CASCADE SAS |
3c4e78f2 |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
d5f74e42 |
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 |
3c4e78f2 |
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_Properties_Header |
17 | #define _BVH_Properties_Header |
18 | |
19 | #include <BVH_Box.hxx> |
20 | |
21 | #include <Standard_Macro.hxx> |
22 | |
23 | //! Abstract properties of geometric object. |
24 | class BVH_Properties |
25 | { |
26 | public: |
27 | |
28 | //! Releases resources of object properties. |
29 | Standard_EXPORT virtual ~BVH_Properties() = 0; |
30 | |
31 | }; |
32 | |
33 | //! Stores transform properties of geometric object. |
34 | template<class T, int N> |
35 | class BVH_Transform : public BVH_Properties |
36 | { |
37 | public: |
38 | |
39 | //! Type of transformation matrix. |
3a7a7013 |
40 | typedef typename BVH::MatrixType<T, N>::Type BVH_MatNt; |
3c4e78f2 |
41 | |
42 | public: |
43 | |
44 | //! Creates new identity transformation. |
45 | BVH_Transform(); |
46 | |
47 | //! Creates new transformation with specified matrix. |
48 | BVH_Transform (const BVH_MatNt& theTransform); |
49 | |
50 | //! Releases resources of transformation properties. |
51 | virtual ~BVH_Transform(); |
52 | |
53 | //! Returns transformation matrix. |
54 | const BVH_MatNt& Transform() const; |
55 | |
56 | //! Sets new transformation matrix. |
57 | void SetTransform (const BVH_MatNt& theTransform); |
58 | |
59 | //! Returns inversed transformation matrix. |
60 | const BVH_MatNt& Inversed() const; |
61 | |
62 | //! Applies transformation matrix to bounding box. |
63 | BVH_Box<T, N> Apply (const BVH_Box<T, N>& theBox) const; |
64 | |
65 | protected: |
66 | |
67 | BVH_MatNt myTransform; //!< Transformation matrix |
68 | BVH_MatNt myTransformInversed; //!< Inversed transformation matrix |
69 | |
70 | }; |
71 | |
72 | #include <BVH_Properties.lxx> |
73 | |
74 | #endif // _BVH_Properties_Header |