OpenLexocad  28.0
Ax2d.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 { class Trsf2d; }
28 namespace Geom { class Vec2d; }
29 
30 namespace Geom
31 {
50 class LX_GEOM_EXPORT Ax2d
51 {
52 public:
54  Ax2d();
55 
59  Ax2d(const Pnt2d& P, const Dir2d& V);
62  double angle(const Ax2d& Other) const;
64  const Dir2d& direction() const;
65 
73  bool isCoaxial(const Ax2d& Other, const double AngularTolerance, const double LinearTolerance) const;
77  bool isNormal(const Ax2d& Other, const double AngularTolerance) const;
82  bool isOpposite(const Ax2d& Other, const double AngularTolerance) const;
87  bool isParallel(const Ax2d& Other, const double AngularTolerance) const;
88 
90  const Pnt2d& location() const;
91  void mirror(const Pnt2d& P);
92 
93  void mirror(const Ax2d& A);
94 
98  Ax2d mirrored(const Pnt2d& P) const;
99 
103  Ax2d mirrored(const Ax2d& A) const;
104 
106  void reverse();
107 
110  Ax2d reversed() const;
111 
112  void rotate(const Pnt2d& P, const double Ang);
113 
117  Ax2d rotated(const Pnt2d& P, const double Ang) const;
118 
119  void scale(const Pnt2d& P, const double S);
120 
124  Ax2d scaled(const Pnt2d& P, const double S) const;
125 
127  void setDirection(const Dir2d& V);
129  void setLocation(const Pnt2d& Locat);
130  void transform(const Trsf2d& T);
132  Ax2d transformed(const Trsf2d& T) const;
133 
134  void translate(const Vec2d& V);
135 
138  Ax2d translated(const Vec2d& V) const;
139 
140  void translate(const Pnt2d& P1, const Pnt2d& P2);
141 
144  Ax2d translated(const Pnt2d& P1, const Pnt2d& P2) const;
145 
146 protected:
147 private:
148  Pnt2d _loc;
149  Dir2d _vdir;
150 };
151 
152 } // namespace Geom
Geom::Ax2d::setLocation
void setLocation(const Pnt2d &Locat)
Changes the "Location" point (origin) of <me>.
Geom::Ax2d::scaled
Ax2d scaled(const Pnt2d &P, const double S) const
Geom::Ax2d::isOpposite
bool isOpposite(const Ax2d &Other, const double AngularTolerance) const
Geom::Ax2d::location
const Pnt2d & location() const
Returns the origin of <me>.
Geom::Ax2d::isParallel
bool isParallel(const Ax2d &Other, const double AngularTolerance) const
Geom::Ax2d::angle
double angle(const Ax2d &Other) const
Geom::Ax2d::transform
void transform(const Trsf2d &T)
Geom::Ax2d::mirrored
Ax2d mirrored(const Ax2d &A) const
Geom::Ax2d::rotated
Ax2d rotated(const Pnt2d &P, const double Ang) const
Dir2d.h
Geom::Ax2d::Ax2d
Ax2d(const Pnt2d &P, const Dir2d &V)
Geom::Ax2d::mirror
void mirror(const Pnt2d &P)
Geom::Ax2d::translated
Ax2d translated(const Vec2d &V) const
Geom::Ax2d::reverse
void reverse()
Reverses the direction of <me> and assigns the result to this axis.
Geom::Ax2d::translate
void translate(const Vec2d &V)
Geom::Dir2d
Definition: Dir2d.h:42
Geom::Ax2d::translate
void translate(const Pnt2d &P1, const Pnt2d &P2)
Geom::Ax2d::scale
void scale(const Pnt2d &P, const double S)
Geom::Ax2d::Ax2d
Ax2d()
Creates an indefinite Ax2d
Geom::Ax2d::direction
const Dir2d & direction() const
Returns the direction of <me>.
Geom::Ax2d::translated
Ax2d translated(const Pnt2d &P1, const Pnt2d &P2) const
Geom::Vec2d
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:33
Pnt2d.h
Geom::Ax2d
Definition: Ax2d.h:51
Geom::Ax2d::setDirection
void setDirection(const Dir2d &V)
Changes the direction of <me>.
Geom::Ax2d::transformed
Ax2d transformed(const Trsf2d &T) const
Transforms an axis placement with a Trsf.
Geom::Ax2d::isCoaxial
bool isCoaxial(const Ax2d &Other, const double AngularTolerance, const double LinearTolerance) const
Geom::Ax2d::mirror
void mirror(const Ax2d &A)
Geom::Ax2d::mirrored
Ax2d mirrored(const Pnt2d &P) const
Geom::Ax2d::isNormal
bool isNormal(const Ax2d &Other, const double AngularTolerance) const
Geom::Pnt2d
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:34
Geom::Trsf2d
Definition: Trsf2d.h:47
Geom::Ax2d::rotate
void rotate(const Pnt2d &P, const double Ang)
Geom::Ax2d::reversed
Ax2d reversed() const
Geom
Definition: PropertyContainer.h:33