OCC22322 Improvement of Extrema performance Standard_EXPORT directive added to the...
[occt.git] / src / BRepExtrema / BRepExtrema_DistanceSS.hxx
CommitLineData
92d1589b
A
1// File generated by CPPExt (Value)
2//
3// Copyright (C) 1991 - 2000 by
4// Matra Datavision SA. All rights reserved.
5//
6// Copyright (C) 2001 - 2004 by
7// Open CASCADE SA. All rights reserved.
8//
9// This file is part of the Open CASCADE Technology software.
10//
11// This software may be distributed and/or modified under the terms and
12// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
13// and appearing in the file LICENSE included in the packaging of this file.
14//
15// This software is distributed on an "AS IS" basis, without warranty of any
16// kind, and Open CASCADE SA hereby disclaims all such warranties,
17// including without limitation, any warranties of merchantability, fitness
18// for a particular purpose or non-infringement. Please see the License for
19// the specific terms and conditions governing rights and limitations under the
20// License.
21
22#ifndef _BRepExtrema_DistanceSS_HeaderFile
23#define _BRepExtrema_DistanceSS_HeaderFile
24
25#ifndef _Standard_HeaderFile
26#include <Standard.hxx>
27#endif
28#ifndef _Standard_Macro_HeaderFile
29#include <Standard_Macro.hxx>
30#endif
31
32#ifndef _BRepExtrema_SeqOfSolution_HeaderFile
33#include <BRepExtrema_SeqOfSolution.hxx>
34#endif
35#ifndef _Standard_Real_HeaderFile
36#include <Standard_Real.hxx>
37#endif
38#ifndef _Standard_Boolean_HeaderFile
39#include <Standard_Boolean.hxx>
40#endif
41#ifndef _Extrema_ExtFlag_HeaderFile
42#include <Extrema_ExtFlag.hxx>
43#endif
44#ifndef _Extrema_ExtAlgo_HeaderFile
45#include <Extrema_ExtAlgo.hxx>
46#endif
47#ifndef _Precision_HeaderFile
48#include <Precision.hxx>
49#endif
50class TopoDS_Shape;
51class Bnd_Box;
52class TopoDS_Vertex;
53class TopoDS_Edge;
54class TopoDS_Face;
55
56
57//! This class allows to compute minimum distance between two shapes <br>
58//! (face edge vertex) and is used in DistShapeShape class. <br>
59class BRepExtrema_DistanceSS
60{
61 public:
62
63 void* operator new(size_t,void* anAddress)
64 {
65 return anAddress;
66 }
67 void* operator new(size_t size)
68 {
69 return Standard::Allocate(size);
70 }
71 void operator delete(void *anAddress)
72 {
73 if (anAddress) Standard::Free((Standard_Address&)anAddress);
74 }
75
76 //! computes the distance between two Shapes ( face edge vertex). <br>
77 Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
78 const Bnd_Box& B1, const Bnd_Box& B2,
79 const Standard_Real DstRef,
80 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
81 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
82 : myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
83 {
84 Perform(S1, S2, B1, B2);
85 }
86 //! computes the distance between two Shapes ( face edge vertex). <br>
87 //! Parameter theDeflection is used to specify a maximum deviation <br>
88 //! of extreme distances from the minimum one. <br>
89 //! Default value is Precision::Confusion(). <br>
90 Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
91 const Bnd_Box& B1, const Bnd_Box& B2,
92 const Standard_Real DstRef, const Standard_Real aDeflection,
93 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
94 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
95 : myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
96 {
97 Perform(S1, S2, B1, B2);
98 }
99 //! True if the distance has been computed <br>
100 Standard_EXPORT Standard_Boolean IsDone() const
101 {
102 return myModif;
103 }
104 //! returns the distance value <br>
105 Standard_EXPORT Standard_Real DistValue() const
106 {
107 return myDstRef;
108 }
109 //! returns the list of solutions on the first shape <br>
110 Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq1Value() const
111 {
112 return SeqSolShape1;
113 }
114 //! returns the list of solutions on the second shape <br>
115 Standard_EXPORT const BRepExtrema_SeqOfSolution& Seq2Value() const
116 {
117 return SeqSolShape2;
118 }
119 //! sets the flag controlling minimum and maximum search
120 Standard_EXPORT void SetFlag(const Extrema_ExtFlag F)
121 {
122 myFlag = F;
123 }
124 //! sets the flag controlling ...
125 Standard_EXPORT void SetAlgo(const Extrema_ExtAlgo A)
126 {
127 myAlgo = A;
128 }
129
130 private:
131
132 //! computes the distance between two Shapes ( face edge vertex) <br>
2a3ff1e0 133 Standard_EXPORT void Perform(const TopoDS_Shape& S1,const TopoDS_Shape& S2,const Bnd_Box& B1,const Bnd_Box& B2);
92d1589b
A
134
135 //! computes the distance between two vertices <br>
136 void Perform(const TopoDS_Vertex& S1,const TopoDS_Vertex& S2);
137 //! computes the minimum distance between a vertex and an edge <br>
138 void Perform(const TopoDS_Vertex& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
139 //! computes the minimum distance between a vertex and a face <br>
140 void Perform(const TopoDS_Vertex& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
141
142 //! computes the minimum distance between an edge and a vertex <br>
6aeb8ed1
A
143 void Perform(const TopoDS_Edge& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2);
144 /*{
92d1589b 145 Perform(S2, S1, B2, B1);
6aeb8ed1 146 }*/
92d1589b
A
147 //! computes the minimum distance between two edges <br>
148 void Perform(const TopoDS_Edge& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
149 //! computes the minimum distance an edge and a face <br>
150 void Perform(const TopoDS_Edge& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
151
152 //! computes the minimum distance betwwen a face and a vertex <br>
6aeb8ed1
A
153 void Perform(const TopoDS_Face& S1,const TopoDS_Vertex& S2,const Bnd_Box& B1,const Bnd_Box& B2);
154 /*{
92d1589b 155 Perform(S2, S1, B2, B1);
6aeb8ed1 156 }*/
92d1589b 157 //! computes the minimum distance between a face and an edge <br>
6aeb8ed1
A
158 void Perform(const TopoDS_Face& S1,const TopoDS_Edge& S2,const Bnd_Box& B1,const Bnd_Box& B2);
159 /*{
92d1589b 160 Perform(S2, S1, B2, B1);
6aeb8ed1 161 }*/
92d1589b
A
162 //! computes the minimum distance between two faces <br>
163 void Perform(const TopoDS_Face& S1,const TopoDS_Face& S2,const Bnd_Box& B1,const Bnd_Box& B2);
164
165 BRepExtrema_SeqOfSolution SeqSolShape1;
166 BRepExtrema_SeqOfSolution SeqSolShape2;
167 Standard_Real myDstRef;
168 Standard_Boolean myModif;
169 Standard_Real myEps;
170 Extrema_ExtFlag myFlag;
171 Extrema_ExtAlgo myAlgo;
172};
173
174#endif