Salome HOME
6f1ddc7739cae39d1d51317413be0c20ed0d0b09
[modules/geom.git] / src / GEOMUtils / GEOMUtils_Trsf2d.hxx
1 // Copyright (C) 2015-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _GEOMUtils_Trsf2d_HXX_
21 #define _GEOMUtils_Trsf2d_HXX_
22
23
24 #include <Geom2dHatch_Hatcher.hxx>
25 #include <GeomAbs_IsoType.hxx>
26 #include <TColStd_HArray1OfInteger.hxx>
27 #include <TColStd_HArray1OfReal.hxx>
28 #include <TopoDS_Face.hxx>
29
30
31 /*!
32  *  This class represents a non-persistent transformation in 2D space. 
33  *  The transformations can be represented as follow :
34  *
35  *       V1   V2   T       XY        XY
36  *    | a11  a12  a13 |   | x |     | x'|
37  *    | a21  a22  a23 |   | y |     | y'|
38  *    |  0    0    1  |   | 1 |     | 1 |
39
40  *  where {V1, V2} defines the vectorial part of the transformation
41  *  and T defines the translation part of the transformation.
42  *  This transformation can change the nature of the objects if it is
43  *  anisotropic.
44  */
45 namespace GEOMUtils
46 {
47   class Trsf2d
48   {
49
50   public:
51     
52     /**
53      * Constructor. Initializes the object with the transformation parameters.
54      * Input parameters are not checked for validity. It is under responsibility
55      * of the caller.
56      */
57     Standard_EXPORT Trsf2d(const Standard_Real a11,
58                            const Standard_Real a12,
59                            const Standard_Real a13,
60                            const Standard_Real a21,
61                            const Standard_Real a22,
62                            const Standard_Real a23);
63
64     /**
65      * Transform the point. The passed parameter is modified to have
66      * a transformed value.
67      *
68      * \param thePnt the point.
69      */
70     Standard_EXPORT void TransformD0(gp_Pnt2d &thePnt)const;
71
72     /**
73      * Transform the point and the first derivative vector. The passed
74      * parameters are modified to have a transformed value.
75      *
76      * \param thePnt the point.
77      * \param theVec1 the first derivative vector.
78      */
79     Standard_EXPORT void TransformD1(gp_Pnt2d &thePnt,
80                                      gp_Vec2d &theVec1) const;
81
82     /**
83      * Transform the point, the first and second derivative vectors. The passed
84      * parameters are modified to have a transformed value.
85      *
86      * \param thePnt the point.
87      * \param theVec1 the first derivative vector.
88      * \param theVec2 the second derivative vector.
89      */
90     Standard_EXPORT void TransformD2(gp_Pnt2d &thePnt,
91                                      gp_Vec2d &theVec1,
92                                      gp_Vec2d &theVec2) const;
93
94     /**
95      * Transform the point, the first, second and third derivative vectors.
96      * The passed parameters are modified to have a transformed value.
97      *
98      * \param thePnt the point.
99      * \param theVec1 the first derivative vector.
100      * \param theVec2 the second derivative vector.
101      * \param theVec2 the third derivative vector.
102      */
103     Standard_EXPORT void TransformD3(gp_Pnt2d &thePnt,
104                                      gp_Vec2d &theVec1,
105                                      gp_Vec2d &theVec2,
106                                      gp_Vec2d &theVec3) const;
107
108   private:
109
110     /**
111      * Transform the vector.
112      *
113      * \param thePnt the point.
114      * \param theVec the vector.
115      */
116     void TransformVector(const gp_Pnt2d &thePnt,
117                                gp_Vec2d &theVec) const;
118
119   private:
120
121     Standard_Real myA11;
122     Standard_Real myA12;
123     Standard_Real myA13;
124     Standard_Real myA21;
125     Standard_Real myA22;
126     Standard_Real myA23;
127
128   };
129 }
130
131 #endif