OpenLexocad  27.1
Trsf2d.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/Mat2d.h>
25 #include <Geom/XY.h>
26 
27 namespace Geom
28 {
29 class Ax2d;
30 class Pnt2d;
31 class Vec2d;
32 
45 
46 class LX_GEOM_EXPORT Trsf2d
47 {
48 public:
49  enum FormEnum
50  {
59  Other
60  };
61 
63  Trsf2d();
66  Trsf2d(const Trsf2d& T);
67 
72  Trsf2d::FormEnum form() const;
77  const Mat2d& hVectorialPart() const;
78 
79  void invert();
80 
85  Trsf2d inverted() const;
86 
89  bool isNegative() const;
90 
91  Trsf2d multiplied(const Trsf2d& T) const;
103  void multiply(const Trsf2d& T);
104  Trsf2d operator*(const Trsf2d& T) const { return multiplied(T); }
105 
106  void operator*=(const Trsf2d& T) { multiply(T); }
107 
108  void power(const int N);
109 
114  Trsf2d powered(const int N);
115 
118  void preMultiply(const Trsf2d& T);
119 
122  double rotationPart() const;
123 
125  double scaleFactor() const;
126 
129  void setMirror(const Pnt2d& P);
130 
133  void setMirror(const Ax2d& A);
134 
138  void setRotation(const Pnt2d& P, const double Ang);
139 
142  void setScale(const Pnt2d& P, const double S);
143 
145  void setScaleFactor(const double S);
148  void setTransformation(const Ax2d& FromSystem1, const Ax2d& ToSystem2);
149 
154  void setTransformation(const Ax2d& ToSystem);
155 
158  void setTranslation(const Vec2d& V);
159 
162  void setTranslation(const Pnt2d& P1, const Pnt2d& P2);
164  void setTranslationPart(const Vec2d& V);
165  void transforms(double& X, double& Y) const;
167  void transforms(XY& Coord) const;
168 
170  const XY& translationPart() const;
171 
175  double value(const int Row, const int Col) const;
176 
179  Mat2d vectorialPart() const;
180 
181  friend class GTrsf2d;
182 
183 protected:
184 private:
185  Geom::XY _loc;
186  Mat2d _matrix;
187  double _scale;
188  Trsf2d::FormEnum _shape;
189 };
190 } // namespace Geom
Definition: Variant.h:60
X
Definition: Globals.h:29
Definition: Trsf2d.h:57
Definition: XY.h:33
Definition: Trsf2d.h:52
Vector3f & operator *=(Vector3f &rclVect, const Matrix4D &rclMtrx)
Definition: Matrix.h:351
Definition: Ax2d.h:48
Definition: Trsf2d.h:53
Definition: Mat2d.h:33
Definition: Trsf2d.h:58
Definition: Trsf2d.h:56
FormEnum
Definition: Trsf2d.h:49
Definition: Trsf2d.h:55
Y
Definition: Globals.h:29
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:34
Definition: GTrsf2d.h:48
Definition: Trsf2d.h:46
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:33
DualNumber operator *(DualNumber a, DualNumber b)
Definition: DualNumber.h:71
Definition: Trsf2d.h:51
Definition: Trsf2d.h:54