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