0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / GeomAPI / GeomAPI_ProjectPointOnSurf.hxx
CommitLineData
42cf5bc1 1// Created on: 1994-03-17
2// Created by: Bruno DUMORTIER
3// Copyright (c) 1994-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 _GeomAPI_ProjectPointOnSurf_HeaderFile
18#define _GeomAPI_ProjectPointOnSurf_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26#include <Extrema_ExtPS.hxx>
27#include <GeomAdaptor_Surface.hxx>
28#include <Extrema_ExtAlgo.hxx>
7868210d 29#include <Extrema_ExtFlag.hxx>
42cf5bc1 30#include <Standard_Real.hxx>
42cf5bc1 31class gp_Pnt;
32class Geom_Surface;
42cf5bc1 33
34
35
36//! This class implements methods for computing all the orthogonal
37//! projections of a point onto a surface.
38class GeomAPI_ProjectPointOnSurf
39{
40public:
41
42 DEFINE_STANDARD_ALLOC
43
44
45 //! Creates an empty object. Use the
46 //! Init function for further initialization.
47 Standard_EXPORT GeomAPI_ProjectPointOnSurf();
48
49 //! Create the projection of a point <P> on a surface
50 //! <Surface>
51 Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
52
53 //! Create the projection of a point <P> on a surface
54 //! <Surface>
55 //! Create the projection of a point <P> on a surface
56 //! <Surface>. The solution are computed in the domain
57 //! [Umin,Usup] [Vmin,Vsup] of the surface.
58 Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
59
09324e85 60 Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
42cf5bc1 61
62 //! Init the projection of a point <P> on a surface
63 //! <Surface>
09324e85 64 Standard_EXPORT GeomAPI_ProjectPointOnSurf(const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
42cf5bc1 65
66 Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
67
68 //! Init the projection of a point <P> on a surface
69 //! <Surface>. The solution are computed in the domain
70 //! [Umin,Usup] [Vmin,Vsup] of the surface.
71 Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
72
09324e85 73 Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
42cf5bc1 74
75 //! Init the projection for many points on a surface
76 //! <Surface>. The solutions will be computed in the domain
77 //! [Umin,Usup] [Vmin,Vsup] of the surface.
09324e85 78 Standard_EXPORT void Init (const gp_Pnt& P, const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
42cf5bc1 79
09324e85 80 Standard_EXPORT void Init (const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Standard_Real Tolerance, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
42cf5bc1 81
09324e85 82 Standard_EXPORT void Init (const Handle(Geom_Surface)& Surface, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real Vmin, const Standard_Real Vsup, const Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Grad);
7868210d 83
84 //! Sets the Extrema search algorithm - Grad or Tree. <br>
85 //! By default the Extrema is initialized with Grad algorithm.
86 void SetExtremaAlgo(const Extrema_ExtAlgo theAlgo)
87 {
88 myExtPS.SetAlgo(theAlgo);
89 }
90
91 //! Sets the Extrema search flag - MIN or MAX or MINMAX.<br>
92 //! By default the Extrema is set to search the MinMax solutions.
93 void SetExtremaFlag(const Extrema_ExtFlag theExtFlag)
94 {
95 myExtPS.SetFlag(theExtFlag);
96 }
97
42cf5bc1 98 //! Performs the projection of a point on the current surface.
99 Standard_EXPORT void Perform (const gp_Pnt& P);
100
101 Standard_EXPORT Standard_Boolean IsDone() const;
102
103 //! Returns the number of computed orthogonal projection points.
104 //! Note: if projection fails, NbPoints returns 0.
105 Standard_EXPORT Standard_Integer NbPoints() const;
106Standard_EXPORT operator Standard_Integer() const;
107
108 //! Returns the orthogonal projection
109 //! on the surface. Index is a number of a computed point.
110 //! Exceptions
111 //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
112 //! NbPoints is the number of solution points.
113 Standard_EXPORT gp_Pnt Point (const Standard_Integer Index) const;
114
115 //! Returns the parameters (U,V) on the
116 //! surface of the orthogonal projection. Index is a number of a
117 //! computed point.
118 //! Exceptions
119 //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
120 //! NbPoints is the number of solution points.
09324e85 121 Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const;
42cf5bc1 122
123 //! Computes the distance between the
124 //! point and its orthogonal projection on the surface. Index is a number
125 //! of a computed point.
126 //! Exceptions
127 //! Standard_OutOfRange if Index is not in the range [ 1,NbPoints ], where
128 //! NbPoints is the number of solution points.
09324e85 129 Standard_EXPORT Standard_Real Distance (const Standard_Integer Index) const;
42cf5bc1 130
131 //! Returns the nearest orthogonal projection of the point
132 //! on the surface.
133 //! Exceptions
134 //! StdFail_NotDone if projection fails.
135 Standard_EXPORT gp_Pnt NearestPoint() const;
136Standard_EXPORT operator gp_Pnt() const;
137
138 //! Returns the parameters (U,V) on the
139 //! surface of the nearest computed orthogonal projection of the point.
140 //! Exceptions
141 //! StdFail_NotDone if projection fails.
09324e85 142 Standard_EXPORT void LowerDistanceParameters (Standard_Real& U, Standard_Real& V) const;
42cf5bc1 143
144 //! Computes the distance between the
145 //! point and its nearest orthogonal projection on the surface.
146 //! Exceptions
147 //! StdFail_NotDone if projection fails.
09324e85 148 Standard_EXPORT Standard_Real LowerDistance() const;
42cf5bc1 149Standard_EXPORT operator Standard_Real() const;
150
151 //! return the algorithmic object from Extrema
152 const Extrema_ExtPS& Extrema() const;
153
42cf5bc1 154private:
155
156
157 Standard_EXPORT void Init();
158
159
160 Standard_Boolean myIsDone;
161 Standard_Integer myIndex;
162 Extrema_ExtPS myExtPS;
163 GeomAdaptor_Surface myGeomAdaptor;
164
165
166};
167
168
169#include <GeomAPI_ProjectPointOnSurf.lxx>
170
171
172
173
174
175#endif // _GeomAPI_ProjectPointOnSurf_HeaderFile