OpenLexocad  27.1
GTrsf2d.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/Trsf2d.h>
25 
26 namespace Geom
27 {
28 class Ax2d;
29 class Mat2d;
30 class XY;
31 
48 class LX_GEOM_EXPORT GTrsf2d
49 {
50 public:
52  GTrsf2d();
55  GTrsf2d(const Trsf2d& T);
59  GTrsf2d(const Mat2d& M, const XY& V);
60 
61 
67  Trsf2d::FormEnum form() const;
68 
69 
70  void invert();
71 
72 
73 
77  GTrsf2d inverted() const;
78 
79 
80 
83  bool isNegative() const;
84 
93  bool isSingular() const;
94 
95 
109  GTrsf2d multiplied(const GTrsf2d& T) const;
110 
111 
112  void multiply(const GTrsf2d& T);
113 
114  void operator*=(const GTrsf2d& T) { multiply(T); }
115 
116  //
117  GTrsf2d operator*(const GTrsf2d& T) const { return multiplied(T); }
118 
119 
120  double operator()(const int Row, const int Col) const { return value(Row, Col); }
121 
122 
123  void power(const int N);
124 
125 
126  GTrsf2d powered(const int N) const;
127 
128 
129 
133  void preMultiply(const GTrsf2d& T);
134 
141  void setAffinity(const Ax2d& A, const double Ratio);
142 
145  void setTranslationPart(const XY& Coord);
146 
148  void setTrsf2d(const Trsf2d& T);
149 
150 
154  void setValue(const int Row, const int Col, const double Value);
156  void setVectorialPart(const Mat2d& Matrix);
157 
158 
160  const XY& translationPart() const;
161 
162 
163 
164  XY transformed(const XY& Coord) const;
165 
166 
167 
168  void transforms(XY& Coord) const;
169 
170 
171 
179  void transforms(double& X, double& Y) const;
180 
181 
182 
187  Trsf2d trsf2d() const;
188 
191  double value(const int Row, const int Col) const;
194  const Mat2d& vectorialPart() const;
195 
196  const Mat2d& _CSFDB_GetGTrsf2dmatrix() const { return matrix; }
197  const XY& _CSFDB_GetGTrsf2dloc() const { return loc; }
198  Trsf2d::FormEnum _CSFDB_GetGTrsf2dshape() const { return shape; }
199  void _CSFDB_SetGTrsf2dshape(const Trsf2d::FormEnum p) { shape = p; }
200  double _CSFDB_GetGTrsf2dscale() const { return scale; }
201  void _CSFDB_SetGTrsf2dscale(const double p) { scale = p; }
202 
203 
204 
205 protected:
206 private:
207  Mat2d matrix;
208  XY loc;
209  Trsf2d::FormEnum shape;
210  double scale;
211 };
212 
213 } // namespace Geom
Definition: Variant.h:60
X
Definition: Globals.h:29
Definition: XY.h:33
void _CSFDB_SetGTrsf2dshape(const Trsf2d::FormEnum p)
Definition: GTrsf2d.h:199
double _CSFDB_GetGTrsf2dscale() const
Definition: GTrsf2d.h:200
const Mat2d & _CSFDB_GetGTrsf2dmatrix() const
Definition: GTrsf2d.h:196
Trsf2d::FormEnum _CSFDB_GetGTrsf2dshape() const
Definition: GTrsf2d.h:198
Vector3f & operator *=(Vector3f &rclVect, const Matrix4D &rclMtrx)
Definition: Matrix.h:351
Definition: Ax2d.h:48
Definition: Mat2d.h:33
void _CSFDB_SetGTrsf2dscale(const double p)
Definition: GTrsf2d.h:201
FormEnum
Definition: Trsf2d.h:49
Y
Definition: Globals.h:29
Definition: GTrsf2d.h:48
double operator()(const int Row, const int Col) const
Definition: GTrsf2d.h:120
Definition: Trsf2d.h:46
const XY & _CSFDB_GetGTrsf2dloc() const
Definition: GTrsf2d.h:197
DualNumber operator *(DualNumber a, DualNumber b)
Definition: DualNumber.h:71