summaryrefslogtreecommitdiff
path: root/src/Geom2d/Geom2d_Geometry.cxx
blob: e91a2b05a89e22c5cd5c3ec25709a045e4efa07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// File:	Geom2d_Geometry.cxx
// Created:	Wed Mar 24 19:22:26 1993
// Author:	JCV
//		<fid@sdsun2>
// Copyright:	Matra Datavision 1993

//File Geom2d_Geometry.cxx, JCV 23/06/91

#include <Geom2d_Geometry.ixx>
#include <Standard_ConstructionError.hxx>

typedef Handle(Geom2d_Geometry) Handle(Geometry);
typedef Geom2d_Geometry Geometry;
typedef gp_Ax2d   Ax2d;
typedef gp_Pnt2d  Pnt2d;
typedef gp_Vec2d  Vec2d;
typedef gp_Trsf2d Trsf2d;



void Geom2d_Geometry::Mirror (const gp_Pnt2d& P) {
   
  Trsf2d T;
  T.SetMirror (P);
  Transform (T);
}



void Geom2d_Geometry::Mirror (const gp_Ax2d& A) {

  Trsf2d T;
  T.SetMirror (A);
  Transform (T);
}


void Geom2d_Geometry::Rotate (const gp_Pnt2d& P, const Standard_Real Ang) {

  Trsf2d T;
  T.SetRotation (P, Ang);
  Transform (T);
}


void Geom2d_Geometry::Scale (const gp_Pnt2d& P, const Standard_Real S) {

  Trsf2d T;
  T.SetScale (P, S);
  Transform (T);
}


void Geom2d_Geometry::Translate (const gp_Vec2d& V) {

  Trsf2d T;
  T.SetTranslation (V);
  Transform (T);
}


void Geom2d_Geometry::Translate (const gp_Pnt2d& P1, const gp_Pnt2d& P2) {

  Vec2d V (P1, P2);
  Translate (V);
}


 Handle(Geometry) Geom2d_Geometry::Mirrored (const gp_Pnt2d& P) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Mirror (P);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Mirrored (const gp_Ax2d& A) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Mirror (A);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Rotated (
const gp_Pnt2d& P, const Standard_Real Ang) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Rotate (P, Ang);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Scaled (
const gp_Pnt2d& P,  const Standard_Real S) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Scale (P, S);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Transformed (const gp_Trsf2d& T) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Transform (T);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Translated (const gp_Vec2d& V) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Translate (V);
  return G;
}


Handle(Geometry) Geom2d_Geometry::Translated (
const gp_Pnt2d& P1, const gp_Pnt2d& P2) const {

  Handle(Geometry) me = this;
  Handle(Geometry) G = me->Copy();
  G->Translate (P1, P2);
  return G;
}