0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / GeomProjLib / GeomProjLib.hxx
1 // Created on: 1993-08-25
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GeomProjLib_HeaderFile
18 #define _GeomProjLib_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 class Geom2d_Curve;
27 class Geom_Curve;
28 class Geom_Surface;
29 class Geom_Plane;
30 class gp_Dir;
31
32
33 //! Projection of a curve on a surface.
34 class GeomProjLib 
35 {
36 public:
37
38   DEFINE_STANDARD_ALLOC
39
40   
41   //! gives  the 2d-curve   of  a 3d-curve  lying on   a
42   //! surface (  uses GeomProjLib_ProjectedCurve   )
43   //! The 3dCurve is taken between the parametrization
44   //! range [First, Last]
45   //! <Tolerance> is used as input if the projection needs
46   //! an approximation. In this case, the reached
47   //! tolerance is set in <Tolerance> as output.
48   //! WARNING :  if   the projection has  failed,   this
49   //! method returns a null Handle.
50   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S, const Standard_Real UFirst, const Standard_Real ULast, const Standard_Real VFirst, const Standard_Real VLast, Standard_Real& Tolerance);
51   
52   //! gives  the 2d-curve   of  a 3d-curve  lying on   a
53   //! surface (  uses GeomProjLib_ProjectedCurve   )
54   //! The 3dCurve is taken between the parametrization
55   //! range [First, Last]
56   //! <Tolerance> is used as input if the projection needs
57   //! an approximation. In this case, the reached
58   //! tolerance is set in <Tolerance> as output.
59   //! WARNING :  if   the projection has  failed,   this
60   //! method returns a null Handle.
61   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S, Standard_Real& Tolerance);
62   
63   //! gives  the 2d-curve   of  a 3d-curve  lying on   a
64   //! surface (  uses GeomProjLib_ProjectedCurve   )
65   //! The 3dCurve is taken between the parametrization
66   //! range [First, Last]
67   //! If the projection needs an approximation,
68   //! Precision::PApproximation() is used.
69   //! WARNING :  if   the projection has  failed,   this
70   //! method returns a null Handle.
71   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S);
72   
73   //! gives  the  2d-curve  of  a  3d-curve lying   on a
74   //! surface   ( uses   GeomProjLib_ProjectedCurve ).
75   //! If the projection needs an approximation,
76   //! Precision::PApproximation() is used.
77   //! WARNING  :  if the   projection has  failed,  this
78   //! method returns a null Handle.
79   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
80   
81   //! gives  the  2d-curve  of  a  3d-curve lying   on a
82   //! surface   ( uses   GeomProjLib_ProjectedCurve ).
83   //! If the projection needs an approximation,
84   //! Precision::PApproximation() is used.
85   //! WARNING  :  if the   projection has  failed,  this
86   //! method returns a null Handle.
87   //! can expand a little the bounds of surface
88   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real UDeb, const Standard_Real UFin, const Standard_Real VDeb, const Standard_Real VFin);
89   
90   //! gives  the  2d-curve  of  a  3d-curve lying   on a
91   //! surface   ( uses   GeomProjLib_ProjectedCurve ).
92   //! If the projection needs an approximation,
93   //! Precision::PApproximation() is used.
94   //! WARNING  :  if the   projection has  failed,  this
95   //! method returns a null Handle.
96   //! can expand a little the bounds of surface
97   Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real UDeb, const Standard_Real UFin, const Standard_Real VDeb, const Standard_Real VFin, Standard_Real& Tolerance);
98   
99   //! Constructs   the  3d-curve  from the normal
100   //! projection  of the  Curve <C> on  the surface <S>.
101   //! WARNING : if the  projection has failes returns  a
102   //! null Handle.
103   Standard_EXPORT static Handle(Geom_Curve) Project (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
104   
105   //! Constructs  the 3d-curves from the projection
106   //! of the  curve  <Curve> on the  plane <Plane> along
107   //! the direction <Dir>.
108   //! If <KeepParametrization> is true, the parametrization
109   //! of the Projected Curve <PC> will be  the same as  the
110   //! parametrization of the initial curve <C>.
111   //! It meens: proj(C(u)) = PC(u) for each u.
112   //! Otherwize, the parametrization may change.
113   Standard_EXPORT static Handle(Geom_Curve) ProjectOnPlane (const Handle(Geom_Curve)& Curve, const Handle(Geom_Plane)& Plane, const gp_Dir& Dir, const Standard_Boolean KeepParametrization);
114
115
116
117
118 protected:
119
120
121
122
123
124 private:
125
126
127
128
129
130 };
131
132
133
134
135
136
137
138 #endif // _GeomProjLib_HeaderFile