1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepExtrema_SolutionElem_HeaderFile
15 #define _BRepExtrema_SolutionElem_HeaderFile
18 #include <BRepExtrema_SupportType.hxx>
19 #include <TopoDS_Vertex.hxx>
20 #include <TopoDS_Edge.hxx>
21 #include <TopoDS_Face.hxx>
23 //! This class is used to store information relative to the minimum distance between two shapes.
24 class BRepExtrema_SolutionElem
31 BRepExtrema_SolutionElem()
33 myPoint (0.0, 0.0, 0.0),
34 mySupType (BRepExtrema_IsVertex),
40 //! This constructor is used when the solution of a distance is a Vertex.
41 //! The different initialized fields are:
42 //! @param theDist the distance
43 //! @param thePoint the solution point
44 //! @param theSolType the type of solution
45 //! @param theVertex and the Vertex
46 BRepExtrema_SolutionElem (const Standard_Real theDist,
47 const gp_Pnt& thePoint,
48 const BRepExtrema_SupportType theSolType,
49 const TopoDS_Vertex& theVertex)
52 mySupType (theSolType),
57 //! This constructor is used when the solution of distance is on an Edge.
58 //! The different initialized fields are:
59 //! @param theDist the distance
60 //! @param thePoint the solution point
61 //! @param theSolType the type of solution
62 //! @param theEdge the Edge
63 //! @param theParam the parameter to locate the solution
64 BRepExtrema_SolutionElem (const Standard_Real theDist,
65 const gp_Pnt& thePoint,
66 const BRepExtrema_SupportType theSolType,
67 const TopoDS_Edge& theEdge,
68 const Standard_Real theParam)
71 mySupType (theSolType),
76 //! This constructor is used when the solution of distance is in a Face.
77 //! The different initialized fields are:
78 //! @param theDist the distance
79 //! @param thePoint the solution point
80 //! @param theSolType the type of solution
81 //! @param theFace the Face
82 //! @param theU U parameter to locate the solution
83 //! @param theV V parameter to locate the solution
84 BRepExtrema_SolutionElem (const Standard_Real theDist,
85 const gp_Pnt& thePoint,
86 const BRepExtrema_SupportType theSolType,
87 const TopoDS_Face& theFace,
88 const Standard_Real theU,
89 const Standard_Real theV)
92 mySupType (theSolType),
97 //! Returns the value of the minimum distance.
98 Standard_Real Dist() const
103 //! Returns the solution point.
104 const gp_Pnt& Point() const
109 //! Returns the Support type:
110 //! IsVertex => The solution is a vertex.
111 //! IsOnEdge => The solution belongs to an Edge.
112 //! IsInFace => The solution is inside a Face.
113 BRepExtrema_SupportType SupportKind() const
118 //! Returns the vertex if the solution is a Vertex.
119 const TopoDS_Vertex& Vertex() const
124 //! Returns the vertex if the solution is an Edge.
125 const TopoDS_Edge& Edge() const
130 //! Returns the vertex if the solution is an Face.
131 const TopoDS_Face& Face() const
136 //! Returns the parameter value if the solution is on Edge.
137 void EdgeParameter (Standard_Real& theParam) const
142 //! Returns the parameters U and V if the solution is in a Face.
143 void FaceParameter (Standard_Real& theU,
144 Standard_Real& theV) const
152 Standard_Real myDist;
154 BRepExtrema_SupportType mySupType;
155 TopoDS_Vertex myVertex;
158 Standard_Real myPar1;
159 Standard_Real myPar2;