File indexing completed on 2026-09-19 09:28:24
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 #include <IntCurve_IntImpConicParConic.hxx>
0021
0022 #include <IntRes2d_Domain.hxx>
0023 #include <IntRes2d_Transition.hxx>
0024 #include <IntRes2d_Position.hxx>
0025
0026 static double PIpPI = M_PI + M_PI;
0027
0028
0029
0030
0031
0032 void Determine_Transition_LC(const IntRes2d_Position,
0033 gp_Vec2d&,
0034 const gp_Vec2d&,
0035 IntRes2d_Transition&,
0036 const IntRes2d_Position,
0037 gp_Vec2d&,
0038 const gp_Vec2d&,
0039 IntRes2d_Transition&,
0040 const double);
0041
0042 double NormalizeOnCircleDomain(const double Param, const IntRes2d_Domain& Domain);
0043
0044
0045
0046
0047 class Interval
0048 {
0049 public:
0050 double Binf;
0051 double Bsup;
0052 bool HasFirstBound;
0053 bool HasLastBound;
0054 bool IsNull;
0055
0056 Interval();
0057 Interval(const double a, const double b);
0058 Interval(const IntRes2d_Domain& Domain);
0059 Interval(const double a, const bool hf, const double b, const bool hl);
0060 double Length();
0061 Interval IntersectionWithBounded(const Interval& Inter);
0062 };
0063
0064
0065
0066
0067 class PeriodicInterval
0068 {
0069 public:
0070 double Binf;
0071 double Bsup;
0072 bool isnull;
0073
0074 void SetNull() { isnull = true; }
0075
0076 bool IsNull() { return (isnull); }
0077
0078 void Complement()
0079 {
0080 if (!isnull)
0081 {
0082 double t = Binf;
0083 Binf = Bsup;
0084 Bsup = t + PIpPI;
0085 if (Binf > PIpPI)
0086 {
0087 Binf -= PIpPI;
0088 Bsup -= PIpPI;
0089 }
0090 }
0091 }
0092
0093 double Length() { return ((isnull) ? -100.0 : std::abs(Bsup - Binf)); }
0094
0095 PeriodicInterval(const IntRes2d_Domain& Domain)
0096 {
0097 isnull = false;
0098 if (Domain.HasFirstPoint())
0099 Binf = Domain.FirstParameter();
0100 else
0101 Binf = -1.0;
0102 if (Domain.HasLastPoint())
0103 Bsup = Domain.LastParameter();
0104 else
0105 Bsup = 20.0;
0106 }
0107
0108 PeriodicInterval()
0109 {
0110 isnull = true;
0111 Binf = Bsup = 0.0;
0112 }
0113
0114 PeriodicInterval(const double a, const double b)
0115 {
0116 isnull = false;
0117 Binf = a;
0118 Bsup = b;
0119 if ((b - a) < PIpPI)
0120 this->Normalize();
0121 }
0122
0123 void SetValues(const double a, const double b)
0124 {
0125 isnull = false;
0126 Binf = a;
0127 Bsup = b;
0128 if ((b - a) < PIpPI)
0129 this->Normalize();
0130 }
0131
0132 void Normalize()
0133 {
0134 if (!isnull)
0135 {
0136 while (Binf > PIpPI)
0137 Binf -= PIpPI;
0138 while (Binf < 0.0)
0139 Binf += PIpPI;
0140 while (Bsup < Binf)
0141 Bsup += PIpPI;
0142 while (Bsup >= (Binf + PIpPI))
0143 Bsup -= PIpPI;
0144 }
0145 }
0146
0147 PeriodicInterval FirstIntersection(PeriodicInterval& I1);
0148 PeriodicInterval SecondIntersection(PeriodicInterval& I2);
0149 };
0150
0151 #endif