ff205346 |
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 | |
14 | |
15 | #ifndef _ShapePersistent_HArray1_HeaderFile |
16 | #define _ShapePersistent_HArray1_HeaderFile |
17 | |
18 | #include <StdLPersistent_HArray1.hxx> |
45d8465e |
19 | #include <StdObject_gp_Vectors.hxx> |
20 | #include <StdObject_gp_Curves.hxx> |
ff205346 |
21 | |
22 | #include <TColgp_HArray1OfXYZ.hxx> |
23 | #include <TColgp_HArray1OfPnt.hxx> |
24 | #include <TColgp_HArray1OfDir.hxx> |
25 | #include <TColgp_HArray1OfVec.hxx> |
26 | #include <TColgp_HArray1OfXY.hxx> |
27 | #include <TColgp_HArray1OfPnt2d.hxx> |
28 | #include <TColgp_HArray1OfDir2d.hxx> |
29 | #include <TColgp_HArray1OfVec2d.hxx> |
30 | #include <TColgp_HArray1OfLin2d.hxx> |
31 | #include <TColgp_HArray1OfCirc2d.hxx> |
32 | #include <Poly_HArray1OfTriangle.hxx> |
33 | |
34 | |
35 | class ShapePersistent_HArray1 : private StdLPersistent_HArray1 |
36 | { |
ff205346 |
37 | public: |
38 | typedef instance<TColgp_HArray1OfXYZ> XYZ; |
39 | typedef instance<TColgp_HArray1OfPnt> Pnt; |
40 | typedef instance<TColgp_HArray1OfDir> Dir; |
41 | typedef instance<TColgp_HArray1OfVec> Vec; |
42 | typedef instance<TColgp_HArray1OfXY> XY; |
43 | typedef instance<TColgp_HArray1OfPnt2d> Pnt2d; |
44 | typedef instance<TColgp_HArray1OfDir2d> Dir2d; |
45 | typedef instance<TColgp_HArray1OfVec2d> Vec2d; |
46 | typedef instance<TColgp_HArray1OfLin2d> Lin2d; |
47 | typedef instance<TColgp_HArray1OfCirc2d> Circ2d; |
48 | typedef instance<Poly_HArray1OfTriangle> Triangle; |
49 | }; |
50 | |
45d8465e |
51 | inline StdObjMgt_ReadData& operator >> |
472433e2 |
52 | (StdObjMgt_ReadData& theReadData, Poly_Triangle& theTriangle) |
45d8465e |
53 | { |
472433e2 |
54 | StdObjMgt_ReadData::ObjectSentry aSentry (theReadData); |
55 | |
45d8465e |
56 | Standard_Integer N1, N2, N3; |
57 | theReadData >> N1 >> N2 >> N3; |
58 | theTriangle.Set (N1, N2, N3); |
59 | return theReadData; |
60 | } |
61 | |
ec964372 |
62 | inline StdObjMgt_WriteData& operator << |
472433e2 |
63 | (StdObjMgt_WriteData& theWriteData, const Poly_Triangle& theTriangle) |
ec964372 |
64 | { |
472433e2 |
65 | StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData); |
66 | |
ec964372 |
67 | Standard_Integer N1, N2, N3; |
68 | theTriangle.Get(N1, N2, N3); |
69 | theWriteData << N1 << N2 << N3; |
70 | return theWriteData; |
71 | } |
72 | |
ff205346 |
73 | #endif |