0022488: Typo in Geom2d_BSplineCurve::LocateU() - which uses a value not adjusted...
[occt.git] / src / Geom2d / Geom2d_Geometry.cxx
CommitLineData
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
12typedef Handle(Geom2d_Geometry) Handle(Geometry);
13typedef Geom2d_Geometry Geometry;
14typedef gp_Ax2d Ax2d;
15typedef gp_Pnt2d Pnt2d;
16typedef gp_Vec2d Vec2d;
17typedef gp_Trsf2d Trsf2d;
18
19
20
21void Geom2d_Geometry::Mirror (const gp_Pnt2d& P) {
22
23 Trsf2d T;
24 T.SetMirror (P);
25 Transform (T);
26}
27
28
29
30void Geom2d_Geometry::Mirror (const gp_Ax2d& A) {
31
32 Trsf2d T;
33 T.SetMirror (A);
34 Transform (T);
35}
36
37
38void 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
46void 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
54void Geom2d_Geometry::Translate (const gp_Vec2d& V) {
55
56 Trsf2d T;
57 T.SetTranslation (V);
58 Transform (T);
59}
60
61
62void 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
78Handle(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
87Handle(Geometry) Geom2d_Geometry::Rotated (
88const 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
97Handle(Geometry) Geom2d_Geometry::Scaled (
98const 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
107Handle(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
116Handle(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
125Handle(Geometry) Geom2d_Geometry::Translated (
126const 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}