File indexing completed on 2025-01-18 10:03:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepExtrema_DistShapeShape_HeaderFile
0015 #define _BRepExtrema_DistShapeShape_HeaderFile
0016
0017 #include <Bnd_Array1OfBox.hxx>
0018 #include <BRepExtrema_SeqOfSolution.hxx>
0019 #include <BRepExtrema_SolutionElem.hxx>
0020 #include <BRepExtrema_SupportType.hxx>
0021 #include <Extrema_ExtAlgo.hxx>
0022 #include <Extrema_ExtFlag.hxx>
0023 #include <Message_ProgressRange.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <Standard_OStream.hxx>
0026 #include <Standard_DefineAlloc.hxx>
0027 #include <TopTools_IndexedMapOfShape.hxx>
0028
0029
0030
0031 class BRepExtrema_DistShapeShape
0032 {
0033 public:
0034
0035 DEFINE_STANDARD_ALLOC
0036
0037
0038 Standard_EXPORT BRepExtrema_DistShapeShape();
0039
0040
0041
0042
0043
0044
0045
0046
0047 Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
0048 const TopoDS_Shape& Shape2,
0049 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
0050 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad,
0051 const Message_ProgressRange& theRange = Message_ProgressRange());
0052
0053
0054
0055
0056
0057
0058
0059
0060 Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
0061 const TopoDS_Shape& Shape2,
0062 const Standard_Real theDeflection,
0063 const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
0064 const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad,
0065 const Message_ProgressRange& theRange = Message_ProgressRange());
0066
0067
0068 void SetDeflection(const Standard_Real theDeflection)
0069 {
0070 myEps = theDeflection;
0071 }
0072
0073
0074 Standard_EXPORT void LoadS1(const TopoDS_Shape& Shape1);
0075
0076
0077 Standard_EXPORT void LoadS2(const TopoDS_Shape& Shape1);
0078
0079
0080
0081
0082
0083
0084
0085 Standard_EXPORT Standard_Boolean Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
0086
0087
0088 Standard_Boolean IsDone() const
0089 {
0090 return myIsDone;
0091 }
0092
0093
0094 Standard_Integer NbSolution() const
0095 {
0096 return mySolutionsShape1.Length();
0097 }
0098
0099
0100 Standard_EXPORT Standard_Real Value() const;
0101
0102
0103
0104 Standard_Boolean InnerSolution() const
0105 {
0106 return myInnerSol;
0107 }
0108
0109
0110 const gp_Pnt & PointOnShape1(const Standard_Integer N) const
0111 {
0112 return mySolutionsShape1.Value(N).Point();
0113 }
0114
0115
0116 const gp_Pnt & PointOnShape2(const Standard_Integer N) const
0117 {
0118 return mySolutionsShape2.Value(N).Point();
0119 }
0120
0121
0122
0123
0124
0125
0126 BRepExtrema_SupportType SupportTypeShape1(const Standard_Integer N) const
0127 {
0128 return mySolutionsShape1.Value(N).SupportKind();
0129 }
0130
0131
0132
0133
0134
0135
0136 BRepExtrema_SupportType SupportTypeShape2(const Standard_Integer N) const
0137 {
0138 return mySolutionsShape2.Value(N).SupportKind();
0139 }
0140
0141
0142
0143 Standard_EXPORT TopoDS_Shape SupportOnShape1(const Standard_Integer N) const;
0144
0145
0146
0147 Standard_EXPORT TopoDS_Shape SupportOnShape2(const Standard_Integer N) const;
0148
0149
0150
0151 Standard_EXPORT void ParOnEdgeS1(const Standard_Integer N,Standard_Real& t) const;
0152
0153
0154
0155 Standard_EXPORT void ParOnEdgeS2(const Standard_Integer N,Standard_Real& t) const;
0156
0157
0158
0159 Standard_EXPORT void ParOnFaceS1(const Standard_Integer N,Standard_Real& u,Standard_Real& v) const;
0160
0161
0162
0163 Standard_EXPORT void ParOnFaceS2(const Standard_Integer N,Standard_Real& u,Standard_Real& v) const;
0164
0165
0166 Standard_EXPORT void Dump(Standard_OStream& o) const;
0167
0168
0169
0170 void SetFlag(const Extrema_ExtFlag F)
0171 {
0172 myFlag = F;
0173 }
0174
0175
0176
0177 void SetAlgo(const Extrema_ExtAlgo A)
0178 {
0179 myAlgo = A;
0180 }
0181
0182
0183 void SetMultiThread(Standard_Boolean theIsMultiThread)
0184 {
0185 myIsMultiThread = theIsMultiThread;
0186 }
0187
0188
0189
0190 Standard_Boolean IsMultiThread() const
0191 {
0192 return myIsMultiThread;
0193 }
0194
0195 private:
0196
0197
0198 Standard_Boolean DistanceMapMap(const TopTools_IndexedMapOfShape& Map1,
0199 const TopTools_IndexedMapOfShape& Map2,
0200 const Bnd_Array1OfBox& LBox1,
0201 const Bnd_Array1OfBox& LBox2,
0202 const Message_ProgressRange& theRange);
0203
0204
0205 Standard_Boolean DistanceVertVert(const TopTools_IndexedMapOfShape& theMap1,
0206 const TopTools_IndexedMapOfShape& theMap2,
0207 const Message_ProgressRange& theRange);
0208
0209 Standard_Boolean SolidTreatment(const TopoDS_Shape& theShape,
0210 const TopTools_IndexedMapOfShape& theMap,
0211 const Message_ProgressRange& theRange);
0212
0213 private:
0214
0215 Standard_Real myDistRef;
0216 Standard_Boolean myIsDone;
0217 BRepExtrema_SeqOfSolution mySolutionsShape1;
0218 BRepExtrema_SeqOfSolution mySolutionsShape2;
0219 Standard_Boolean myInnerSol;
0220 Standard_Real myEps;
0221 TopoDS_Shape myShape1;
0222 TopoDS_Shape myShape2;
0223 TopTools_IndexedMapOfShape myMapV1;
0224 TopTools_IndexedMapOfShape myMapV2;
0225 TopTools_IndexedMapOfShape myMapE1;
0226 TopTools_IndexedMapOfShape myMapE2;
0227 TopTools_IndexedMapOfShape myMapF1;
0228 TopTools_IndexedMapOfShape myMapF2;
0229 Standard_Boolean myIsInitS1;
0230 Standard_Boolean myIsInitS2;
0231 Extrema_ExtFlag myFlag;
0232 Extrema_ExtAlgo myAlgo;
0233 Bnd_Array1OfBox myBV1;
0234 Bnd_Array1OfBox myBV2;
0235 Bnd_Array1OfBox myBE1;
0236 Bnd_Array1OfBox myBE2;
0237 Bnd_Array1OfBox myBF1;
0238 Bnd_Array1OfBox myBF2;
0239 Standard_Boolean myIsMultiThread;
0240 };
0241
0242 #endif