File indexing completed on 2025-01-18 10:04:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef IntCurve_IntConicConic_Tool_HeaderFile
0018 #define IntCurve_IntConicConic_Tool_HeaderFile
0019
0020
0021 #include <IntCurve_IntImpConicParConic.hxx>
0022
0023 #include <IntRes2d_Domain.hxx>
0024 #include <IntRes2d_Transition.hxx>
0025 #include <IntRes2d_Position.hxx>
0026
0027
0028 static Standard_Real PIpPI = M_PI + M_PI;
0029
0030
0031
0032
0033
0034 void Determine_Transition_LC(const IntRes2d_Position,
0035 gp_Vec2d&,
0036 const gp_Vec2d&,
0037 IntRes2d_Transition&,
0038 const IntRes2d_Position,
0039 gp_Vec2d&,
0040 const gp_Vec2d&,
0041 IntRes2d_Transition&,
0042 const Standard_Real);
0043
0044 Standard_Real NormalizeOnCircleDomain(const Standard_Real Param,const IntRes2d_Domain& Domain);
0045
0046
0047
0048 class Interval {
0049 public:
0050 Standard_Real Binf;
0051 Standard_Real Bsup;
0052 Standard_Boolean HasFirstBound;
0053 Standard_Boolean HasLastBound;
0054 Standard_Boolean IsNull;
0055
0056 Interval();
0057 Interval(const Standard_Real a,const Standard_Real b);
0058 Interval(const IntRes2d_Domain& Domain);
0059 Interval( const Standard_Real a,const Standard_Boolean hf
0060 ,const Standard_Real b,const Standard_Boolean hl);
0061 Standard_Real Length();
0062 Interval IntersectionWithBounded(const Interval& Inter);
0063 };
0064
0065
0066
0067
0068
0069
0070 class PeriodicInterval {
0071 public:
0072 Standard_Real Binf;
0073 Standard_Real Bsup;
0074 Standard_Boolean isnull;
0075
0076 void SetNull() { isnull=Standard_True; }
0077 Standard_Boolean IsNull() { return(isnull); }
0078
0079 void Complement() { if(!isnull) {
0080 Standard_Real t=Binf; Binf=Bsup; Bsup=t+PIpPI;
0081 if(Binf>PIpPI) {
0082 Binf-=PIpPI;
0083 Bsup-=PIpPI;
0084 }
0085 }
0086 }
0087
0088 Standard_Real Length() { return((isnull)? -100.0: Abs(Bsup-Binf)); }
0089
0090
0091 PeriodicInterval(const IntRes2d_Domain& Domain) {
0092 isnull=Standard_False;
0093 if(Domain.HasFirstPoint())
0094 Binf=Domain.FirstParameter();
0095 else
0096 Binf=-1.0;
0097 if(Domain.HasLastPoint())
0098 Bsup=Domain.LastParameter();
0099 else
0100 Bsup=20.0;
0101 }
0102 PeriodicInterval() { isnull=Standard_True; Binf=Bsup=0.0; }
0103 PeriodicInterval(const Standard_Real a,const Standard_Real b)
0104 {
0105 isnull=Standard_False;
0106 Binf=a;
0107 Bsup=b;
0108 if((b-a) < PIpPI)
0109 this->Normalize();
0110 }
0111 void SetValues(const Standard_Real a,const Standard_Real b)
0112 {
0113 isnull=Standard_False;
0114 Binf=a;
0115 Bsup=b;
0116 if((b-a) < PIpPI)
0117 this->Normalize();
0118 }
0119 void Normalize() {
0120 if(!isnull) {
0121 while(Binf>PIpPI) Binf-=PIpPI;
0122 while(Binf<0.0) Binf+=PIpPI;
0123 while(Bsup<Binf) Bsup+=PIpPI;
0124 while(Bsup>=(Binf+PIpPI)) Bsup-=PIpPI;
0125 }
0126 }
0127
0128 PeriodicInterval FirstIntersection(PeriodicInterval& I1);
0129 PeriodicInterval SecondIntersection(PeriodicInterval& I2);
0130 };
0131
0132
0133 #endif