OpenLexocad  27.1
Ax22d.h
Go to the documentation of this file.
1 //
3 // Copyright(C) 2013-2016 OpenCascade [www.opencascade.org]
4 //
5 // This library is free software; you can redistribute it and / or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street,
18 // Fifth Floor, Boston, MA 02110 - 1301 USA
19 //
21 
22 #pragma once
23 
24 #include <Geom/Dir2d.h>
25 #include <Geom/Pnt2d.h>
26 
27 namespace Geom
28 {
29 class Ax2d;
30 class Trsf2d;
31 class Vec2d;
32 
50 class LX_GEOM_EXPORT Ax22d
51 {
52 public:
54  Ax22d();
55 
62  Ax22d(const Pnt2d& P, const Dir2d& Vx, const Dir2d& Vy);
63 
68  Ax22d(const Pnt2d& P, const Dir2d& V, const bool Sense = true);
69 
74  Ax22d(const Ax2d& A, const bool Sense = true);
75 
77  const Pnt2d& location() const;
78 
79  void mirror(const Pnt2d& P);
80 
81  void mirror(const Ax2d& A);
82 
90  Ax22d mirrored(const Pnt2d& P) const;
91 
99  Ax22d mirrored(const Ax2d& A) const;
100 
101  void rotate(const Pnt2d& P, const double Ang);
102 
106  Ax22d rotated(const Pnt2d& P, const double Ang) const;
107 
108  void scale(const Pnt2d& P, const double S);
109 
117  Ax22d scaled(const Pnt2d& P, const double S) const;
118 
121  void setAxis(const Ax22d& A1);
122 
124  void setLocation(const Pnt2d& P);
125 
129  void setXAxis(const Ax2d& A1);
135  void setXDirection(const Dir2d& Vx);
138  void setYAxis(const Ax2d& A1);
139 
145  void setYDirection(const Dir2d& Vy);
146  void transform(const Trsf2d& T);
147 
153  Ax22d transformed(const Trsf2d& T) const;
154 
155  void translate(const Vec2d& V);
156 
157  void translate(const Pnt2d& P1, const Pnt2d& P2);
158 
161  Ax22d translated(const Vec2d& V) const;
162 
165  Ax22d translated(const Pnt2d& P1, const Pnt2d& P2) const;
170  Ax2d xAxis() const;
172  const Dir2d& xDirection() const;
173 
178  Ax2d yAxis() const;
179 
181  const Dir2d& yDirection() const;
182 
183  const Pnt2d& _CSFDB_GetAx22dpoint() const { return point; }
184  const Dir2d& _CSFDB_GetAx22dvydir() const { return vydir; }
185  const Dir2d& _CSFDB_GetAx22dvxdir() const { return vxdir; }
186 
187  bool operator==(const Ax22d& other) const;
188 
189 private:
190  Pnt2d point;
191  Dir2d vydir;
192  Dir2d vxdir;
193 };
194 
195 } // namespace Geom
Definition: Variant.h:60
const Dir2d & _CSFDB_GetAx22dvydir() const
Definition: Ax22d.h:184
Definition: Ax2d.h:48
Definition: Dir2d.h:38
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:34
const Pnt2d & _CSFDB_GetAx22dpoint() const
Definition: Ax22d.h:183
Definition: Trsf2d.h:46
const Dir2d & _CSFDB_GetAx22dvxdir() const
Definition: Ax22d.h:185
Definition: Ax22d.h:50
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:33