7fd59977 |
1 | // File: Geom2d_Geometry.cxx |
2 | // Created: Wed Mar 24 19:22:26 1993 |
3 | // Author: JCV |
4 | // <fid@sdsun2> |
5 | // Copyright: Matra Datavision 1993 |
6 | |
7 | //File Geom2d_Geometry.cxx, JCV 23/06/91 |
8 | |
9 | #include <Geom2d_Geometry.ixx> |
10 | #include <Standard_ConstructionError.hxx> |
11 | |
12 | typedef Handle(Geom2d_Geometry) Handle(Geometry); |
13 | typedef Geom2d_Geometry Geometry; |
14 | typedef gp_Ax2d Ax2d; |
15 | typedef gp_Pnt2d Pnt2d; |
16 | typedef gp_Vec2d Vec2d; |
17 | typedef gp_Trsf2d Trsf2d; |
18 | |
19 | |
20 | |
21 | void Geom2d_Geometry::Mirror (const gp_Pnt2d& P) { |
22 | |
23 | Trsf2d T; |
24 | T.SetMirror (P); |
25 | Transform (T); |
26 | } |
27 | |
28 | |
29 | |
30 | void Geom2d_Geometry::Mirror (const gp_Ax2d& A) { |
31 | |
32 | Trsf2d T; |
33 | T.SetMirror (A); |
34 | Transform (T); |
35 | } |
36 | |
37 | |
38 | void Geom2d_Geometry::Rotate (const gp_Pnt2d& P, const Standard_Real Ang) { |
39 | |
40 | Trsf2d T; |
41 | T.SetRotation (P, Ang); |
42 | Transform (T); |
43 | } |
44 | |
45 | |
46 | void Geom2d_Geometry::Scale (const gp_Pnt2d& P, const Standard_Real S) { |
47 | |
48 | Trsf2d T; |
49 | T.SetScale (P, S); |
50 | Transform (T); |
51 | } |
52 | |
53 | |
54 | void Geom2d_Geometry::Translate (const gp_Vec2d& V) { |
55 | |
56 | Trsf2d T; |
57 | T.SetTranslation (V); |
58 | Transform (T); |
59 | } |
60 | |
61 | |
62 | void Geom2d_Geometry::Translate (const gp_Pnt2d& P1, const gp_Pnt2d& P2) { |
63 | |
64 | Vec2d V (P1, P2); |
65 | Translate (V); |
66 | } |
67 | |
68 | |
69 | Handle(Geometry) Geom2d_Geometry::Mirrored (const gp_Pnt2d& P) const { |
70 | |
71 | Handle(Geometry) me = this; |
72 | Handle(Geometry) G = me->Copy(); |
73 | G->Mirror (P); |
74 | return G; |
75 | } |
76 | |
77 | |
78 | Handle(Geometry) Geom2d_Geometry::Mirrored (const gp_Ax2d& A) const { |
79 | |
80 | Handle(Geometry) me = this; |
81 | Handle(Geometry) G = me->Copy(); |
82 | G->Mirror (A); |
83 | return G; |
84 | } |
85 | |
86 | |
87 | Handle(Geometry) Geom2d_Geometry::Rotated ( |
88 | const gp_Pnt2d& P, const Standard_Real Ang) const { |
89 | |
90 | Handle(Geometry) me = this; |
91 | Handle(Geometry) G = me->Copy(); |
92 | G->Rotate (P, Ang); |
93 | return G; |
94 | } |
95 | |
96 | |
97 | Handle(Geometry) Geom2d_Geometry::Scaled ( |
98 | const gp_Pnt2d& P, const Standard_Real S) const { |
99 | |
100 | Handle(Geometry) me = this; |
101 | Handle(Geometry) G = me->Copy(); |
102 | G->Scale (P, S); |
103 | return G; |
104 | } |
105 | |
106 | |
107 | Handle(Geometry) Geom2d_Geometry::Transformed (const gp_Trsf2d& T) const { |
108 | |
109 | Handle(Geometry) me = this; |
110 | Handle(Geometry) G = me->Copy(); |
111 | G->Transform (T); |
112 | return G; |
113 | } |
114 | |
115 | |
116 | Handle(Geometry) Geom2d_Geometry::Translated (const gp_Vec2d& V) const { |
117 | |
118 | Handle(Geometry) me = this; |
119 | Handle(Geometry) G = me->Copy(); |
120 | G->Translate (V); |
121 | return G; |
122 | } |
123 | |
124 | |
125 | Handle(Geometry) Geom2d_Geometry::Translated ( |
126 | const gp_Pnt2d& P1, const gp_Pnt2d& P2) const { |
127 | |
128 | Handle(Geometry) me = this; |
129 | Handle(Geometry) G = me->Copy(); |
130 | G->Translate (P1, P2); |
131 | return G; |
132 | } |