File indexing completed on 2025-01-18 10:04:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _IntWalk_PWalking_HeaderFile
0018 #define _IntWalk_PWalking_HeaderFile
0019
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Dir.hxx>
0022 #include <IntImp_ConstIsoparametric.hxx>
0023 #include <IntSurf_PntOn2S.hxx>
0024 #include <gp_Dir2d.hxx>
0025 #include <IntWalk_TheInt2S.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <IntWalk_StatusDeflection.hxx>
0028
0029 class gp_Pnt;
0030
0031
0032
0033
0034
0035 class IntWalk_PWalking
0036 {
0037 public:
0038
0039 DEFINE_STANDARD_ALLOC
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1,
0058 const Handle(Adaptor3d_Surface)& Caro2,
0059 const Standard_Real TolTangency,
0060 const Standard_Real Epsilon,
0061 const Standard_Real Deflection,
0062 const Standard_Real Increment);
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 Standard_EXPORT IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1,
0078 const Handle(Adaptor3d_Surface)& Caro2,
0079 const Standard_Real TolTangency,
0080 const Standard_Real Epsilon,
0081 const Standard_Real Deflection,
0082 const Standard_Real Increment,
0083 const Standard_Real U1,
0084 const Standard_Real V1,
0085 const Standard_Real U2,
0086 const Standard_Real V2);
0087
0088
0089 Standard_EXPORT void Perform (const TColStd_Array1OfReal& ParDep);
0090
0091
0092
0093
0094
0095
0096 Standard_EXPORT void Perform (const TColStd_Array1OfReal& ParDep,
0097 const Standard_Real u1min,
0098 const Standard_Real v1min,
0099 const Standard_Real u2min,
0100 const Standard_Real v2min,
0101 const Standard_Real u1max,
0102 const Standard_Real v1max,
0103 const Standard_Real u2max,
0104 const Standard_Real v2max);
0105
0106
0107 Standard_EXPORT Standard_Boolean PerformFirstPoint (const TColStd_Array1OfReal& ParDep,
0108 IntSurf_PntOn2S& FirstPoint);
0109
0110
0111 Standard_Boolean IsDone() const;
0112
0113
0114
0115 Standard_Integer NbPoints() const;
0116
0117
0118
0119
0120 const IntSurf_PntOn2S& Value (const Standard_Integer Index) const;
0121
0122 const Handle(IntSurf_LineOn2S)& Line() const;
0123
0124
0125
0126
0127 Standard_Boolean TangentAtFirst() const;
0128
0129
0130
0131
0132 Standard_Boolean TangentAtLast() const;
0133
0134
0135
0136 Standard_Boolean IsClosed() const;
0137
0138 const gp_Dir& TangentAtLine (Standard_Integer& Index) const;
0139
0140 Standard_EXPORT IntWalk_StatusDeflection TestDeflection (const IntImp_ConstIsoparametric ChoixIso,
0141 const IntWalk_StatusDeflection theStatus);
0142
0143 Standard_EXPORT Standard_Boolean TestArret (const Standard_Boolean DejaReparti,
0144 TColStd_Array1OfReal& Param,
0145 IntImp_ConstIsoparametric& ChoixIso);
0146
0147 Standard_EXPORT void RepartirOuDiviser (Standard_Boolean& DejaReparti,
0148 IntImp_ConstIsoparametric& ChoixIso,
0149 Standard_Boolean& Arrive);
0150
0151
0152 void AddAPoint (const IntSurf_PntOn2S& thePOn2S);
0153
0154
0155
0156
0157
0158 void RemoveAPoint(const Standard_Integer theIndex)
0159 {
0160 const Standard_Integer anIdx = Min(theIndex, line->NbPoints());
0161
0162 if (anIdx < 1)
0163 return;
0164
0165 if (anIdx <= myTangentIdx)
0166 {
0167 myTangentIdx--;
0168
0169 if (myTangentIdx < 1)
0170 myTangentIdx = 1;
0171 }
0172
0173 line->RemovePoint(anIdx);
0174 }
0175
0176 Standard_EXPORT Standard_Boolean PutToBoundary (const Handle(Adaptor3d_Surface)& theASurf1,
0177 const Handle(Adaptor3d_Surface)& theASurf2);
0178
0179 Standard_EXPORT Standard_Boolean SeekAdditionalPoints (const Handle(Adaptor3d_Surface)& theASurf1,
0180 const Handle(Adaptor3d_Surface)& theASurf2,
0181 const Standard_Integer theMinNbPoints);
0182
0183 Standard_Real MaxStep(Standard_Integer theIndex)
0184 {
0185 Standard_OutOfRange_Raise_if ((theIndex < 0) || (theIndex > 3),
0186 "IntWalk_PWalking::MaxStep() - index is out of range");
0187 return pasInit[theIndex];
0188 }
0189
0190
0191
0192 protected:
0193 Standard_EXPORT void ComputePasInit(const Standard_Real theDeltaU1,
0194 const Standard_Real theDeltaV1,
0195 const Standard_Real theDeltaU2,
0196 const Standard_Real theDeltaV2);
0197
0198
0199
0200
0201
0202 Standard_EXPORT Standard_Boolean DistanceMinimizeByGradient(const Handle(Adaptor3d_Surface)& theASurf1,
0203 const Handle(Adaptor3d_Surface)& theASurf2,
0204 TColStd_Array1OfReal& theInit,
0205 const Standard_Real* theStep0 = 0);
0206
0207
0208
0209
0210
0211
0212 Standard_EXPORT Standard_Boolean DistanceMinimizeByExtrema (const Handle(Adaptor3d_Surface)& theASurf,
0213 const gp_Pnt& theP0,
0214 Standard_Real& theU0,
0215 Standard_Real& theV0,
0216 const Standard_Real* theStep0 = 0);
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229 Standard_EXPORT Standard_Boolean SeekPointOnBoundary (const Handle(Adaptor3d_Surface)& theASurf1,
0230 const Handle(Adaptor3d_Surface)& theASurf2,
0231 const Standard_Real theU1,
0232 const Standard_Real theV1,
0233 const Standard_Real theU2,
0234 const Standard_Real theV2,
0235 const Standard_Boolean isTheFirst);
0236
0237
0238
0239 Standard_EXPORT Standard_Boolean HandleSingleSingularPoint(const Handle(Adaptor3d_Surface) &theASurf1,
0240 const Handle(Adaptor3d_Surface) &theASurf2,
0241 const Standard_Real the3DTol,
0242 TColStd_Array1OfReal &thePnt);
0243
0244 Standard_EXPORT Standard_Boolean ExtendLineInCommonZone (const IntImp_ConstIsoparametric theChoixIso,
0245 const Standard_Boolean theDirectionFlag);
0246
0247 private:
0248 Standard_Boolean done;
0249 Handle(IntSurf_LineOn2S) line;
0250 Standard_Boolean close;
0251 Standard_Boolean tgfirst;
0252 Standard_Boolean tglast;
0253
0254
0255
0256 Standard_Integer myTangentIdx;
0257
0258
0259 gp_Dir tgdir;
0260
0261 Standard_Real fleche;
0262 Standard_Real pasMax;
0263 Standard_Real tolconf;
0264 Standard_Real myTolTang;
0265 Standard_Real pasuv[4];
0266 Standard_Real myStepMin[4];
0267 Standard_Real pasSav[4];
0268 Standard_Real pasInit[4];
0269 Standard_Real Um1;
0270 Standard_Real UM1;
0271 Standard_Real Vm1;
0272 Standard_Real VM1;
0273 Standard_Real Um2;
0274 Standard_Real UM2;
0275 Standard_Real Vm2;
0276 Standard_Real VM2;
0277 Standard_Real ResoU1;
0278 Standard_Real ResoU2;
0279 Standard_Real ResoV1;
0280 Standard_Real ResoV2;
0281 Standard_Integer sensCheminement;
0282 IntImp_ConstIsoparametric choixIsoSav;
0283 IntSurf_PntOn2S previousPoint;
0284 Standard_Boolean previoustg;
0285 gp_Dir previousd;
0286 gp_Dir2d previousd1;
0287 gp_Dir2d previousd2;
0288 gp_Dir2d firstd1;
0289 gp_Dir2d firstd2;
0290 IntWalk_TheInt2S myIntersectionOn2S;
0291 Standard_Integer STATIC_BLOCAGE_SUR_PAS_TROP_GRAND;
0292 Standard_Integer STATIC_PRECEDENT_INFLEXION;
0293
0294
0295 };
0296
0297
0298 #include <IntWalk_PWalking.lxx>
0299
0300
0301
0302
0303
0304 #endif