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& theReadData, gp_Mat2d& theMat)
30 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
32 >> theMat(1, 1) >> theMat(1, 2)
33 >> theMat(2, 1) >> theMat(2, 2);
37 inline StdObjMgt_WriteData& operator <<
38 (StdObjMgt_WriteData& theWriteData, const gp_Mat2d& theMat)
40 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
43 << theMat(1, 1) << theMat(1, 2)
44 << theMat(2, 1) << theMat(2, 2);
48 inline StdObjMgt_ReadData& operator >>
49 (StdObjMgt_ReadData& theReadData, gp_Mat& theMat)
51 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
53 >> theMat(1, 1) >> theMat(1, 2) >> theMat(1, 3)
54 >> theMat(2, 1) >> theMat(2, 2) >> theMat(2, 3)
55 >> theMat(3, 1) >> theMat(3, 2) >> theMat(3, 3);
59 inline StdObjMgt_WriteData& operator <<
60 (StdObjMgt_WriteData& theWriteData, const gp_Mat& theMat)
62 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
65 << theMat(1, 1) << theMat(1, 2) << theMat(1, 3)
66 << theMat(2, 1) << theMat(2, 2) << theMat(2, 3)
67 << theMat(3, 1) << theMat(3, 2) << theMat(3, 3);
71 inline StdObjMgt_ReadData& operator >>
72 (StdObjMgt_ReadData& theReadData, gp_Trsf2d& theTrsf)
74 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
77 Standard_Integer aForm;
81 theReadData >> aScale >> aForm >> aMat >> aLoc;
83 theTrsf.SetValues (aScale * aMat(1, 1), aScale * aMat(1, 2), aLoc.X(),
84 aScale * aMat(2, 1), aScale * aMat(2, 2), aLoc.Y());
89 inline StdObjMgt_WriteData& operator <<
90 (StdObjMgt_WriteData& theWriteData, const gp_Trsf2d& theTrsf)
92 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
94 Standard_Real aScale = theTrsf.ScaleFactor();
95 Standard_Integer aForm = theTrsf.Form();
96 const gp_Mat2d& aMat = theTrsf.HVectorialPart();
97 const gp_XY& aLoc = theTrsf.TranslationPart();
99 theWriteData << aScale << aForm << aMat << aLoc;
104 inline StdObjMgt_ReadData& operator >>
105 (StdObjMgt_ReadData& theReadData, gp_Trsf& theTrsf)
107 StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
109 Standard_Real aScale;
110 Standard_Integer aForm;
114 theReadData >> aScale >> aForm >> aMat >> aLoc;
117 aScale * aMat(1, 1), aScale * aMat(1, 2), aScale * aMat(1, 3), aLoc.X(),
118 aScale * aMat(2, 1), aScale * aMat(2, 2), aScale * aMat(2, 3), aLoc.Y(),
119 aScale * aMat(3, 1), aScale * aMat(3, 2), aScale * aMat(3, 3), aLoc.Z());
124 inline StdObjMgt_WriteData& operator <<
125 (StdObjMgt_WriteData& theWriteData, const gp_Trsf& theTrsf)
127 StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
129 Standard_Real aScale = theTrsf.ScaleFactor();
130 Standard_Integer aForm = theTrsf.Form();
131 const gp_Mat& aMat = theTrsf.HVectorialPart();
132 const gp_XYZ& aLoc = theTrsf.TranslationPart();
134 theWriteData << aScale << aForm << aMat << aLoc;