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.
15 #ifndef _StdObject_gp_Trsfs_HeaderFile
16 #define _StdObject_gp_Trsfs_HeaderFile
19 #include <StdObject_gp_Vectors.hxx>
21 #include <gp_Mat2d.hxx>
23 #include <gp_Trsf2d.hxx>
24 #include <gp_Trsf.hxx>
27 inline StdObjMgt_ReadData& operator >>
28 (StdObjMgt_ReadData::Object theReadData, gp_Mat2d& theMat)
31 >> theMat(1, 1) >> theMat(1, 2)
32 >> theMat(2, 1) >> theMat(2, 2);
36 inline StdObjMgt_WriteData& operator <<
37 (StdObjMgt_WriteData::Object theWriteData, const gp_Mat2d& theMat)
40 << theMat(1, 1) << theMat(1, 2)
41 << theMat(2, 1) << theMat(2, 2);
45 inline StdObjMgt_ReadData& operator >>
46 (StdObjMgt_ReadData::Object theReadData, gp_Mat& theMat)
49 >> theMat(1, 1) >> theMat(1, 2) >> theMat(1, 3)
50 >> theMat(2, 1) >> theMat(2, 2) >> theMat(2, 3)
51 >> theMat(3, 1) >> theMat(3, 2) >> theMat(3, 3);
55 inline StdObjMgt_WriteData& operator <<
56 (StdObjMgt_WriteData::Object theWriteData, const gp_Mat& theMat)
59 << theMat(1, 1) << theMat(1, 2) << theMat(1, 3)
60 << theMat(2, 1) << theMat(2, 2) << theMat(2, 3)
61 << theMat(3, 1) << theMat(3, 2) << theMat(3, 3);
65 inline StdObjMgt_ReadData& operator >>
66 (StdObjMgt_ReadData::Object theReadData, gp_Trsf2d& theTrsf)
69 Standard_Integer aForm;
73 theReadData >> aScale >> aForm >> aMat >> aLoc;
75 theTrsf.SetValues (aScale * aMat(1, 1), aScale * aMat(1, 2), aLoc.X(),
76 aScale * aMat(2, 1), aScale * aMat(2, 2), aLoc.Y());
81 inline StdObjMgt_WriteData& operator <<
82 (StdObjMgt_WriteData::Object theWriteData, const gp_Trsf2d& theTrsf)
84 Standard_Real aScale = theTrsf.ScaleFactor();
85 Standard_Integer aForm = theTrsf.Form();
86 const gp_Mat2d& aMat = theTrsf.HVectorialPart();
87 const gp_XY& aLoc = theTrsf.TranslationPart();
89 theWriteData << aScale << aForm << aMat << aLoc;
94 inline StdObjMgt_ReadData& operator >>
95 (StdObjMgt_ReadData::Object theReadData, gp_Trsf& theTrsf)
98 Standard_Integer aForm;
102 theReadData >> aScale >> aForm >> aMat >> aLoc;
105 aScale * aMat(1, 1), aScale * aMat(1, 2), aScale * aMat(1, 3), aLoc.X(),
106 aScale * aMat(2, 1), aScale * aMat(2, 2), aScale * aMat(2, 3), aLoc.Y(),
107 aScale * aMat(3, 1), aScale * aMat(3, 2), aScale * aMat(3, 3), aLoc.Z());
112 inline StdObjMgt_WriteData& operator <<
113 (StdObjMgt_WriteData::Object theWriteData, const gp_Trsf& theTrsf)
115 Standard_Real aScale = theTrsf.ScaleFactor();
116 Standard_Integer aForm = theTrsf.Form();
117 const gp_Mat& aMat = theTrsf.HVectorialPart();
118 const gp_XYZ& aLoc = theTrsf.TranslationPart();
120 theWriteData << aScale << aForm << aMat << aLoc;