Warning, file /include/opencascade/IntTools_CurveRangeSample.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _IntTools_CurveRangeSample_HeaderFile
0017 #define _IntTools_CurveRangeSample_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022
0023 #include <IntTools_BaseRangeSample.hxx>
0024 #include <Standard_HashUtils.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_Real.hxx>
0027
0028 class IntTools_Range;
0029
0030
0031 class IntTools_CurveRangeSample : public IntTools_BaseRangeSample
0032 {
0033 public:
0034
0035 DEFINE_STANDARD_ALLOC
0036
0037
0038 Standard_EXPORT IntTools_CurveRangeSample();
0039
0040 Standard_EXPORT IntTools_CurveRangeSample(const Standard_Integer theIndex);
0041
0042 void SetRangeIndex (const Standard_Integer theIndex) { myIndex = theIndex; }
0043
0044 Standard_Integer GetRangeIndex() const { return myIndex; }
0045
0046 Standard_Boolean IsEqual (const IntTools_CurveRangeSample& Other) const
0047 {
0048 return ((myIndex == Other.myIndex) && (GetDepth() == Other.GetDepth()));
0049 }
0050
0051 bool operator==(const IntTools_CurveRangeSample& Other) const
0052 {
0053 return IsEqual(Other);
0054 }
0055
0056 Standard_EXPORT IntTools_Range GetRange (const Standard_Real theFirst, const Standard_Real theLast, const Standard_Integer theNbSample) const;
0057
0058 Standard_Integer GetRangeIndexDeeper (const Standard_Integer theNbSample) const
0059 {
0060 return myIndex * theNbSample;
0061 }
0062
0063 private:
0064
0065 Standard_Integer myIndex;
0066
0067 };
0068
0069 namespace std
0070 {
0071 template <>
0072 struct hash<IntTools_CurveRangeSample>
0073 {
0074 size_t operator()(const IntTools_CurveRangeSample& theCurveRangeSample) const noexcept
0075 {
0076
0077 int aCombination[2]{ theCurveRangeSample.GetDepth(), theCurveRangeSample.GetRangeIndex() };
0078 return opencascade::hashBytes(aCombination, sizeof(aCombination));
0079 }
0080 };
0081 }
0082
0083 #endif