OpenLexocad  27.0
GTrsf.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/GeomEnums.h>
25 #include <Geom/Trsf.h>
26 #include <Geom/geom_defines.h>
27 
28 
29 
46 
47 namespace Geom
48 {
50 {
51 public:
53  GTrsf();
54 
58  GTrsf(const Geom::Trsf& T);
59 
63  GTrsf(const Geom::Mat& M, const Geom::XYZ& V);
71  void SetAffinity(const Geom::Ax1& A1, const double Ratio);
80  void SetAffinity(const Geom::Ax2& A2, const double Ratio);
81 
85  void SetValue(const int Row, const int Col, const double Value);
87  void SetVectorialPart(const Geom::Mat& Matrix);
90  void SetTranslationPart(const Geom::XYZ& Coord);
92  void SetTrsf(const Geom::Trsf& T);
93 
96  unsigned int IsNegative() const;
97 
106  unsigned int IsSingular() const;
107 
113  Geom::Trsf::FormEnum Form() const;
114 
121  void SetForm();
123  const Geom::XYZ& TranslationPart() const;
124 
127  const Geom::Mat& VectorialPart() const;
128 
131  double Value(const int Row, const int Col) const;
132  double operator()(const int Row, const int Col) const { return Value(Row, Col); }
133 
134  void Invert();
135 
139  Geom::GTrsf Inverted() const;
140 
155  void Multiply(const Geom::GTrsf& T);
156 
159  Geom::GTrsf Multiplied(const Geom::GTrsf& T) const;
160 
164  void PreMultiply(const Geom::GTrsf& T);
165 
166  void Power(const int N);
167 
178  Geom::GTrsf Powered(const int N) const;
179 
180  void Transforms(Geom::XYZ& Coord) const;
182  void Transforms(double& X, double& Y, double& Z) const;
183 
184  Geom::Trsf Trsf(bool aAllowOtherFormInConstruction = false) const;
185  // const Geom::Mat& _CSFDB_GetGTrsfmatrix() const { return matrix; }
186  // const Geom::XYZ& _CSFDB_GetGTrsfloc() const { return loc; }
187  // Base::TrsfForm _CSFDB_GetGTrsfshape() const { return shape; }
188  // void _CSFDB_SetGTrsfshape(const Base::TrsfForm p) { shape = p; }
189  // double _CSFDB_GetGTrsfscale() const { return scale; }
190  // void _CSFDB_SetGTrsfscale(const double p) { scale = p; }
191 
192 
193 
194 protected:
195 private:
196  Geom::Mat matrix;
197  Geom::XYZ loc;
198  Geom::Trsf::FormEnum shape;
199  double scale;
200 };
201 
202 
203 
204 } // namespace Geom
Definition: Rotation.h:5
X
Definition: Globals.h:32
Definition: Mat.h:41
#define GEOM_EXPORT
Definition: geom_defines.h:8
Definition: Ax2.h:69
Definition: XYZ.h:46
Definition: Trsf.h:58
Y
Definition: Globals.h:32
double operator()(const int Row, const int Col) const
Definition: GTrsf.h:132
FormEnum
Definition: Trsf.h:96
Definition: Ax1.h:52
Z
Definition: Globals.h:32
Definition: GTrsf.h:49