Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/SelectMgr_VectorTypes.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _SelectMgr_VectorTypes_HeaderFile
0015 #define _SelectMgr_VectorTypes_HeaderFile
0016 
0017 #include <gp_Trsf.hxx>
0018 #include <NCollection_Mat4.hxx>
0019 #include <NCollection_Vec3.hxx>
0020 #include <NCollection_Vec4.hxx>
0021 
0022 typedef NCollection_Vec3<Standard_Real>    SelectMgr_Vec3;
0023 typedef NCollection_Vec4<Standard_Real>    SelectMgr_Vec4;
0024 typedef NCollection_Mat4<Standard_Real>    SelectMgr_Mat4;
0025 
0026 namespace SelectMgr_MatOp
0027 {
0028   inline SelectMgr_Vec3 Transform (const gp_Trsf& theTrsf,
0029                             const SelectMgr_Vec3& theVec)
0030   {
0031     SelectMgr_Vec3 aRes (0.0);
0032     for (Standard_Integer aRow = 1; aRow <= 3; ++aRow)
0033     {
0034       for (Standard_Integer aCol = 1; aCol <= 3; ++aCol)
0035       {
0036         aRes[aRow - 1] += theVec[aCol - 1] * theTrsf.Value (aRow, aCol);
0037       }
0038       aRes[aRow - 1] += theTrsf.Value (aRow, 4);
0039     }
0040 
0041     return aRes;
0042   }
0043 }
0044 
0045 #endif // _SelectMgr_VectorTypes_HeaderFile