1 // Copyright (c) 2015 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _SelectMgr_VectorTypes_HeaderFile
15 #define _SelectMgr_VectorTypes_HeaderFile
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>
23 typedef NCollection_Vec3<Standard_Real> SelectMgr_Vec3;
24 typedef NCollection_Vec4<Standard_Real> SelectMgr_Vec4;
25 typedef NCollection_Mat4<Standard_Real> SelectMgr_Mat4;
27 namespace SelectMgr_MatOp
29 inline SelectMgr_Vec3 Transform (const gp_Trsf& theTrsf,
30 const SelectMgr_Vec3& theVec)
32 SelectMgr_Vec3 aRes (0.0);
33 for (Standard_Integer aRow = 1; aRow <= 3; ++aRow)
35 for (Standard_Integer aCol = 1; aCol <= 3; ++aCol)
37 aRes[aRow - 1] += theVec[aCol - 1] * theTrsf.Value (aRow, aCol);
39 aRes[aRow - 1] += theTrsf.Value (aRow, 4);
46 #endif // _SelectMgr_VectorTypes_HeaderFile