Warnings on vc14 were eliminated
[occt.git] / src / BRepExtrema / BRepExtrema_DistanceSS.hxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
92d1589b 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
92d1589b 4//
d5f74e42 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
973c2be1 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.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
92d1589b
A
13
14#ifndef _BRepExtrema_DistanceSS_HeaderFile
15#define _BRepExtrema_DistanceSS_HeaderFile
16
92d1589b 17#include <BRepExtrema_SeqOfSolution.hxx>
92d1589b 18#include <Extrema_ExtFlag.hxx>
92d1589b 19#include <Extrema_ExtAlgo.hxx>
92d1589b 20#include <Precision.hxx>
ebc93ae7 21#include <Standard_DefineAlloc.hxx>
22
92d1589b
A
23class TopoDS_Shape;
24class Bnd_Box;
25class TopoDS_Vertex;
26class TopoDS_Edge;
27class TopoDS_Face;
28
29
30//! This class allows to compute minimum distance between two shapes <br>
31//! (face edge vertex) and is used in DistShapeShape class. <br>
32class BRepExtrema_DistanceSS
33{
34 public:
35
1c35b92f 36 DEFINE_STANDARD_ALLOC
92d1589b
A
37
38 //! computes the distance between two Shapes ( face edge vertex). <br>
39 Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
40 const Bnd_Box& B1, const Bnd_Box& B2,
41 const Standard_Real DstRef,
42 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
43 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
44 : myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
45 {
46 Perform(S1, S2, B1, B2);
47 }
48 //! computes the distance between two Shapes ( face edge vertex). <br>
49 //! Parameter theDeflection is used to specify a maximum deviation <br>
50 //! of extreme distances from the minimum one. <br>
51 //! Default value is Precision::Confusion(). <br>
52 Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
53 const Bnd_Box& B1, const Bnd_Box& B2,
54 const Standard_Real DstRef, const Standard_Real aDeflection,
55 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
56 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
57 : myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
58 {
59 Perform(S1, S2, B1, B2);
60 }
61 //! True if the distance has been computed <br>
62 Standard_EXPORT Standard_Boolean IsDone() const
63 {
64 return myModif;
65 }
66 //! returns the distance value <br>
67 Standard_EXPORT Standard_Real DistValue() const
68 {
69 return myDstRef;
70 }
71 //! returns the list of solutions on the first shape <br>
72 Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq1Value() const
73 {
74 return SeqSolShape1;
75 }
76 //! returns the list of solutions on the second shape <br>
77 Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq2Value() const
78 {
79 return SeqSolShape2;
80 }
81 //! sets the flag controlling minimum and maximum search
82 Standard_EXPORT void SetFlag(const Extrema_ExtFlag F)
83 {
84 myFlag = F;
85 }
86 //! sets the flag controlling ...
87 Standard_EXPORT void SetAlgo(const Extrema_ExtAlgo A)
88 {
89 myAlgo = A;
90 }
91
92 private:
93
94 //! computes the distance between two Shapes ( face edge vertex) <br>
2a3ff1e0 95 Standard_EXPORT void Perform(const TopoDS_Shape& S1,const TopoDS_Shape& S2,const Bnd_Box& B1,const Bnd_Box& B2);
92d1589b
A
96
97 //! computes the distance between two vertices <br>
98 void Perform(const TopoDS_Vertex& S1,const TopoDS_Vertex& S2);
99 //! computes the minimum distance between a vertex and an edge <br>
100 void Perform(const TopoDS_Vertex& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
101 //! computes the minimum distance between a vertex and a face <br>
102 void Perform(const TopoDS_Vertex& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
103
104 //! computes the minimum distance between an edge and a vertex <br>
6aeb8ed1
A
105 void Perform(const TopoDS_Edge& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2);
106 /*{
92d1589b 107 Perform(S2, S1, B2, B1);
6aeb8ed1 108 }*/
92d1589b
A
109 //! computes the minimum distance between two edges <br>
110 void Perform(const TopoDS_Edge& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
111 //! computes the minimum distance an edge and a face <br>
112 void Perform(const TopoDS_Edge& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
113
114 //! computes the minimum distance betwwen a face and a vertex <br>
6aeb8ed1
A
115 void Perform(const TopoDS_Face& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2);
116 /*{
92d1589b 117 Perform(S2, S1, B2, B1);
6aeb8ed1 118 }*/
92d1589b 119 //! computes the minimum distance between a face and an edge <br>
6aeb8ed1
A
120 void Perform(const TopoDS_Face& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
121 /*{
92d1589b 122 Perform(S2, S1, B2, B1);
6aeb8ed1 123 }*/
92d1589b
A
124 //! computes the minimum distance between two faces <br>
125 void Perform(const TopoDS_Face& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
126
127 BRepExtrema_SeqOfSolution SeqSolShape1;
128 BRepExtrema_SeqOfSolution SeqSolShape2;
129 Standard_Real myDstRef;
130 Standard_Boolean myModif;
131 Standard_Real myEps;
132 Extrema_ExtFlag myFlag;
133 Extrema_ExtAlgo myAlgo;
134};
135
136#endif