17470159 |
1 | // Copyright (c) 2015 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
f751596e |
14 | #ifndef _SelectMgr_VectorTypes_HeaderFile |
15 | #define _SelectMgr_VectorTypes_HeaderFile |
16 | |
17 | #include <gp_Trsf.hxx> |
18 | #include <NCollection_Array1.hxx> |
19 | #include <NCollection_Mat4.hxx> |
20 | #include <NCollection_Vec3.hxx> |
21 | #include <NCollection_Vec4.hxx> |
22 | |
23 | typedef NCollection_Vec3<Standard_Real> SelectMgr_Vec3; |
24 | typedef NCollection_Vec4<Standard_Real> SelectMgr_Vec4; |
25 | typedef NCollection_Mat4<Standard_Real> SelectMgr_Mat4; |
26 | |
27 | namespace SelectMgr_MatOp |
28 | { |
29 | inline SelectMgr_Vec3 Transform (const gp_Trsf& theTrsf, |
30 | const SelectMgr_Vec3& theVec) |
31 | { |
32 | SelectMgr_Vec3 aRes (0.0); |
33 | for (Standard_Integer aRow = 1; aRow <= 3; ++aRow) |
34 | { |
35 | for (Standard_Integer aCol = 1; aCol <= 3; ++aCol) |
36 | { |
37 | aRes[aRow - 1] += theVec[aCol - 1] * theTrsf.Value (aRow, aCol); |
38 | } |
39 | aRes[aRow - 1] += theTrsf.Value (aRow, 4); |
40 | } |
41 | |
42 | return aRes; |
43 | } |
a3f6f591 |
44 | } |
f751596e |
45 | |
46 | #endif // _SelectMgr_VectorTypes_HeaderFile |