OpenLexocad  28.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/Trsf.h>
25 
26 
27 
28 
45 
46 namespace Geom
47 {
48 class LX_GEOM_EXPORT GTrsf
49 {
50 public:
52  GTrsf();
53 
57  GTrsf(const Geom::Trsf& T);
58 
62  GTrsf(const Geom::Mat& M, const Geom::XYZ& V);
70  void SetAffinity(const Geom::Ax1& A1, const double Ratio);
79  void SetAffinity(const Geom::Ax2& A2, const double Ratio);
80 
84  void SetValue(const int Row, const int Col, const double Value);
86  void SetVectorialPart(const Geom::Mat& Matrix);
89  void SetTranslationPart(const Geom::XYZ& Coord);
91  void SetTrsf(const Geom::Trsf& T);
92 
95  unsigned int IsNegative() const;
96 
105  unsigned int IsSingular() const;
106 
113 
120  void SetForm();
122  const Geom::XYZ& TranslationPart() const;
123 
126  const Geom::Mat& VectorialPart() const;
127 
130  double Value(const int Row, const int Col) const;
131  double operator()(const int Row, const int Col) const { return Value(Row, Col); }
132 
133  void Invert();
134 
139 
154  void Multiply(const Geom::GTrsf& T);
155 
159 
163  void PreMultiply(const Geom::GTrsf& T);
164 
165  void Power(const int N);
166 
177  Geom::GTrsf Powered(const int N) const;
178 
179  void Transforms(Geom::XYZ& Coord) const;
181  void Transforms(double& X, double& Y, double& Z) const;
182 
183  Geom::Trsf Trsf(bool aAllowOtherFormInConstruction = false) const;
184  // const Geom::Mat& _CSFDB_GetGTrsfmatrix() const { return matrix; }
185  // const Geom::XYZ& _CSFDB_GetGTrsfloc() const { return loc; }
186  // Base::TrsfForm _CSFDB_GetGTrsfshape() const { return shape; }
187  // void _CSFDB_SetGTrsfshape(const Base::TrsfForm p) { shape = p; }
188  // double _CSFDB_GetGTrsfscale() const { return scale; }
189  // void _CSFDB_SetGTrsfscale(const double p) { scale = p; }
190 
191 
192 
193 protected:
194 private:
195  Geom::Mat matrix;
196  Geom::XYZ loc;
197  Geom::Trsf::FormEnum shape;
198  double scale;
199 };
200 
201 
202 
203 } // namespace Geom
Geom::GTrsf::PreMultiply
void PreMultiply(const Geom::GTrsf &T)
Trsf.h
Geom::GTrsf::Multiplied
Geom::GTrsf Multiplied(const Geom::GTrsf &T) const
Geom::GTrsf::VectorialPart
const Geom::Mat & VectorialPart() const
Geom::GTrsf::Inverted
Geom::GTrsf Inverted() const
X
X
Definition: Globals.h:29
Geom::Ax1
Definition: Ax1.h:50
Geom::XYZ
Definition: XYZ.h:44
Geom::GTrsf::Form
Geom::Trsf::FormEnum Form() const
Geom::GTrsf
Definition: GTrsf.h:49
Geom::GTrsf::Value
double Value(const int Row, const int Col) const
Geom::GTrsf::SetAffinity
void SetAffinity(const Geom::Ax2 &A2, const double Ratio)
Geom::GTrsf::IsSingular
unsigned int IsSingular() const
Geom::GTrsf::SetForm
void SetForm()
Geom::GTrsf::Transforms
void Transforms(double &X, double &Y, double &Z) const
Transforms a triplet XYZ with a GTrsf.
Geom::GTrsf::Powered
Geom::GTrsf Powered(const int N) const
Geom::Ax2
Definition: Ax2.h:66
Geom::GTrsf::operator()
double operator()(const int Row, const int Col) const
Definition: GTrsf.h:131
Z
Z
Definition: Globals.h:31
Geom::GTrsf::SetVectorialPart
void SetVectorialPart(const Geom::Mat &Matrix)
Replaces the vectorial part of this transformation by Matrix.
Geom::GTrsf::SetValue
void SetValue(const int Row, const int Col, const double Value)
Geom::GTrsf::GTrsf
GTrsf(const Geom::Mat &M, const Geom::XYZ &V)
Y
Y
Definition: Globals.h:30
Geom::GTrsf::SetTrsf
void SetTrsf(const Geom::Trsf &T)
Assigns the vectorial and translation parts of T to this transformation.
Geom::GTrsf::Transforms
void Transforms(Geom::XYZ &Coord) const
Geom::GTrsf::Invert
void Invert()
Geom::GTrsf::Multiply
void Multiply(const Geom::GTrsf &T)
Geom::GTrsf::TranslationPart
const Geom::XYZ & TranslationPart() const
Returns the translation part of the GTrsf.
Geom::GTrsf::GTrsf
GTrsf()
Returns the Identity transformation.
Geom::GTrsf::Trsf
Geom::Trsf Trsf(bool aAllowOtherFormInConstruction=false) const
Geom::Trsf
Definition: Trsf.h:58
Geom::Trsf::FormEnum
FormEnum
Definition: Trsf.h:97
Geom::GTrsf::GTrsf
GTrsf(const Geom::Trsf &T)
Geom::GTrsf::Power
void Power(const int N)
Geom::GTrsf::SetAffinity
void SetAffinity(const Geom::Ax1 &A1, const double Ratio)
Geom::GTrsf::IsNegative
unsigned int IsNegative() const
Geom::Mat
Definition: Mat.h:37
Geom::GTrsf::SetTranslationPart
void SetTranslationPart(const Geom::XYZ &Coord)
Geom
Definition: PropertyContainer.h:33