0028564: Support of applications using old persistence (ShapeSchema)
[occt.git] / src / ShapePersistent / ShapePersistent_Geom2d.hxx
CommitLineData
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_Geom2d_HeaderFile
16#define _ShapePersistent_Geom2d_HeaderFile
17
ec964372 18#include <StdObjMgt_TransientPersistentMap.hxx>
ff205346 19#include <ShapePersistent_Geom.hxx>
20
21#include <Geom2d_CartesianPoint.hxx>
22#include <Geom2d_Direction.hxx>
23#include <Geom2d_VectorWithMagnitude.hxx>
24#include <Geom2d_AxisPlacement.hxx>
25#include <Geom2d_Transformation.hxx>
26#include <Geom2d_Curve.hxx>
27
ec964372 28class ShapePersistent_Geom2d : public ShapePersistent_Geom
ff205346 29{
30 typedef geometryBase<Geom2d_Geometry> basic;
31
32public:
33 typedef ShapePersistent_Geom::Geometry Geometry;
34
35 typedef subBase_empty<basic> Point;
36 typedef instance<Point, Geom2d_CartesianPoint, gp_Pnt2d> CartesianPoint;
37
38 typedef subBase_gp<basic, gp_Vec2d> Vector;
39 typedef instance<Vector, Geom2d_Direction , gp_Dir2d> Direction;
40 typedef instance<Vector, Geom2d_VectorWithMagnitude, gp_Vec2d> VectorWithMagnitude;
41
42 typedef instance<basic, Geom2d_AxisPlacement, gp_Ax2d> AxisPlacement;
43
44 typedef instance <SharedBase<Geom2d_Transformation>,
45 Geom2d_Transformation,
46 gp_Trsf2d> Transformation;
47
48 typedef geometryBase<Geom2d_Curve> Curve;
ec964372 49
50public:
51 //! Create a persistent object for a curve
52 Standard_EXPORT static Handle(Curve) Translate (const Handle(Geom2d_Curve)& theCurve,
53 StdObjMgt_TransientPersistentMap& theMap);
ff205346 54};
55
ec964372 56//=======================================================================
57// Geometry
58//=======================================================================
59template<>
60Standard_CString ShapePersistent_Geom::geometryBase<Geom2d_Geometry>
61 ::PName() const;
62
63//=======================================================================
64// Point
65//=======================================================================
66template<>
67Standard_CString ShapePersistent_Geom::subBase_empty<
68 ShapePersistent_Geom2d::geometryBase<Geom2d_Geometry> >
69 ::PName() const;
70
71//=======================================================================
72// CartesianPoint
73//=======================================================================
74template<>
75Standard_CString ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Point,
76 Geom2d_CartesianPoint,
77 gp_Pnt2d>
78 ::PName() const;
79
80template<>
81void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Point,
82 Geom2d_CartesianPoint,
83 gp_Pnt2d>
84 ::Write(StdObjMgt_WriteData& theWriteData) const;
85
86//=======================================================================
87// Direction
88//=======================================================================
89template<>
90Standard_CString ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Direction,
91 Geom2d_Direction,
92 gp_Dir2d>
93 ::PName() const;
94
95template<>
96void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Direction,
97 Geom2d_Direction,
98 gp_Dir2d>
99 ::Write(StdObjMgt_WriteData& theWriteData) const;
100
101//=======================================================================
102// VectorWithMagnitude
103//=======================================================================
104template<>
105Standard_CString ShapePersistent_Geom::instance<ShapePersistent_Geom2d::VectorWithMagnitude,
106 Geom2d_VectorWithMagnitude,
107 gp_Vec2d>
108 ::PName() const;
109
110template<>
111void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::VectorWithMagnitude,
112 Geom2d_VectorWithMagnitude,
113 gp_Vec2d>
114 ::Write(StdObjMgt_WriteData& theWriteData) const;
115
116//=======================================================================
117// AxisPlacement
118//=======================================================================
119template<>
120Standard_CString ShapePersistent_Geom::instance<ShapePersistent_Geom2d::AxisPlacement,
121 Geom2d_AxisPlacement,
122 gp_Ax2d>
123 ::PName() const;
124
125template<>
126void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::AxisPlacement,
127 Geom2d_AxisPlacement,
128 gp_Ax2d>
129 ::Write(StdObjMgt_WriteData& theWriteData) const;
130
131//=======================================================================
132// Transformation
133//=======================================================================
134template<>
135Standard_CString ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Transformation,
136 Geom2d_Transformation,
137 gp_Trsf2d>
138 ::PName() const;
139
140template<>
141void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Transformation,
142 Geom2d_Transformation,
143 gp_Trsf2d>
144 ::PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const;
145
146template<>
147void ShapePersistent_Geom::instance<ShapePersistent_Geom2d::Transformation,
148 Geom2d_Transformation,
149 gp_Trsf2d>
150 ::Write(StdObjMgt_WriteData& theWriteData) const;
151
152//=======================================================================
153// Curve
154//=======================================================================
155template<>
156Standard_CString ShapePersistent_Geom2d::geometryBase<Geom2d_Curve>
157 ::PName() const;
158
ff205346 159#endif