1 // Created on: 2003-03-18
2 // Created by: Oleg FEDYAEV
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15 
16 #ifndef _GeomLib_Tool_HeaderFile
17 #define _GeomLib_Tool_HeaderFile
18 
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22 
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Real.hxx>
25 class Geom_Curve;
26 class gp_Pnt;
27 class Geom_Surface;
28 class Geom2d_Curve;
29 class gp_Pnt2d;
30 
31 
32 //! Provides various methods with Geom2d and Geom curves and surfaces.
33 //! The methods of this class compute the parameter(s) of a given point on a
34 //! curve or a surface. To get the valid result the point must be located rather close
35 //! to the curve (surface) or at least to allow getting unambiguous result
36 //! (do not put point at center of circle...),
37 //! but choice of "trust" distance between curve/surface and point is
38 //! responcibility of user (parameter MaxDist).
39 //! Return FALSE if the point is beyond the MaxDist
40 //! limit or if computation fails.
41 class GeomLib_Tool
42 {
43 public:
44 
45   DEFINE_STANDARD_ALLOC
46 
47 
48 
49   //! Extracts the parameter of a 3D point lying on a 3D curve
50   //! or at a distance less than the MaxDist value.
51   Standard_EXPORT static Standard_Boolean Parameter (const Handle(Geom_Curve)& Curve, const gp_Pnt& Point, const Standard_Real MaxDist, Standard_Real& U);
52 
53   //! Extracts the parameter of a 3D point lying on a surface
54   //! or at a distance less than the MaxDist value.
55   Standard_EXPORT static Standard_Boolean Parameters (const Handle(Geom_Surface)& Surface, const gp_Pnt& Point, const Standard_Real MaxDist, Standard_Real& U, Standard_Real& V);
56 
57   //! Extracts the parameter of a 2D point lying on a 2D curve
58   //! or at a distance less than the MaxDist value.
59   Standard_EXPORT static Standard_Boolean Parameter (const Handle(Geom2d_Curve)& Curve, const gp_Pnt2d& Point, const Standard_Real MaxDist, Standard_Real& U);
60 
61 
62 
63 
64 protected:
65 
66 
67 
68 
69 
70 private:
71 
72 
73 
74 
75 
76 };
77 
78 
79 
80 
81 
82 
83 
84 #endif // _GeomLib_Tool_HeaderFile
85