Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntTools_SurfaceRangeSample.lxx is written in an unsupported language. File is not indexed.

0001 // Created on: 2005-10-05
0002 // Created by: Mikhail KLOKOV
0003 // Copyright (c) 2005-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #include <Standard_HashUtils.hxx>
0017 
0018 inline void IntTools_SurfaceRangeSample::SetRanges(const IntTools_CurveRangeSample& theRangeU,
0019                                                    const IntTools_CurveRangeSample& theRangeV)
0020 {
0021   myRangeU = theRangeU;
0022   myRangeV = theRangeV;
0023 }
0024 
0025 inline void IntTools_SurfaceRangeSample::GetRanges(IntTools_CurveRangeSample& theRangeU,
0026                                                    IntTools_CurveRangeSample& theRangeV) const
0027 {
0028   theRangeU = myRangeU;
0029   theRangeV = myRangeV;
0030 }
0031 
0032 inline void IntTools_SurfaceRangeSample::SetIndexes(const Standard_Integer theIndexU,
0033                                                     const Standard_Integer theIndexV)
0034 {
0035   myRangeU.SetRangeIndex(theIndexU);
0036   myRangeV.SetRangeIndex(theIndexV);
0037 }
0038 
0039 inline void IntTools_SurfaceRangeSample::GetIndexes(Standard_Integer& theIndexU,
0040                                                     Standard_Integer& theIndexV) const
0041 {
0042   theIndexU = myRangeU.GetRangeIndex();
0043   theIndexV = myRangeV.GetRangeIndex();
0044 }
0045 
0046 inline void IntTools_SurfaceRangeSample::GetDepths(Standard_Integer& theDepthU,
0047                                                    Standard_Integer& theDepthV) const
0048 {
0049   theDepthU = myRangeU.GetDepth();
0050   theDepthV = myRangeV.GetDepth();
0051 }
0052 
0053 inline void IntTools_SurfaceRangeSample::SetSampleRangeU(
0054   const IntTools_CurveRangeSample& theRangeSampleU)
0055 {
0056   myRangeU = theRangeSampleU;
0057 }
0058 
0059 inline const IntTools_CurveRangeSample& IntTools_SurfaceRangeSample::GetSampleRangeU() const
0060 {
0061   return myRangeU;
0062 }
0063 
0064 inline void IntTools_SurfaceRangeSample::SetSampleRangeV(
0065   const IntTools_CurveRangeSample& theRangeSampleV)
0066 {
0067   myRangeV = theRangeSampleV;
0068 }
0069 
0070 inline const IntTools_CurveRangeSample& IntTools_SurfaceRangeSample::GetSampleRangeV() const
0071 {
0072   return myRangeV;
0073 }
0074 
0075 inline void IntTools_SurfaceRangeSample::SetIndexU(const Standard_Integer theIndexU)
0076 {
0077   myRangeU.SetRangeIndex(theIndexU);
0078 }
0079 
0080 inline Standard_Integer IntTools_SurfaceRangeSample::GetIndexU() const
0081 {
0082   return myRangeU.GetRangeIndex();
0083 }
0084 
0085 inline void IntTools_SurfaceRangeSample::SetIndexV(const Standard_Integer theIndexV)
0086 {
0087   myRangeV.SetRangeIndex(theIndexV);
0088 }
0089 
0090 inline Standard_Integer IntTools_SurfaceRangeSample::GetIndexV() const
0091 {
0092   return myRangeV.GetRangeIndex();
0093 }
0094 
0095 inline void IntTools_SurfaceRangeSample::SetDepthU(const Standard_Integer theDepthU)
0096 {
0097   myRangeU.SetDepth(theDepthU);
0098 }
0099 
0100 inline Standard_Integer IntTools_SurfaceRangeSample::GetDepthU() const
0101 {
0102   return myRangeU.GetDepth();
0103 }
0104 
0105 inline void IntTools_SurfaceRangeSample::SetDepthV(const Standard_Integer theDepthV)
0106 {
0107   myRangeV.SetDepth(theDepthV);
0108 }
0109 
0110 inline Standard_Integer IntTools_SurfaceRangeSample::GetDepthV() const
0111 {
0112   return myRangeV.GetDepth();
0113 }
0114 
0115 inline Standard_Boolean IntTools_SurfaceRangeSample::IsEqual(
0116   const IntTools_SurfaceRangeSample& Other) const
0117 {
0118   return (myRangeU.IsEqual(Other.myRangeU) && myRangeV.IsEqual(Other.myRangeV));
0119 }
0120 
0121 inline Standard_Integer IntTools_SurfaceRangeSample::GetRangeIndexUDeeper(
0122   const Standard_Integer theNbSampleU) const
0123 {
0124   return myRangeU.GetRangeIndexDeeper(theNbSampleU);
0125 }
0126 
0127 inline Standard_Integer IntTools_SurfaceRangeSample::GetRangeIndexVDeeper(
0128   const Standard_Integer theNbSampleV) const
0129 {
0130   return myRangeV.GetRangeIndexDeeper(theNbSampleV);
0131 }
0132 
0133 namespace std
0134 {
0135 template <>
0136 struct hash<IntTools_SurfaceRangeSample>
0137 {
0138   size_t operator()(const IntTools_SurfaceRangeSample& theSurfaceRangeSample) const noexcept
0139   {
0140     // Combine two int values into a single hash value.
0141     size_t aCombination[2]{
0142       std::hash<IntTools_CurveRangeSample>{}(theSurfaceRangeSample.GetSampleRangeU()),
0143       std::hash<IntTools_CurveRangeSample>{}(theSurfaceRangeSample.GetSampleRangeV())};
0144     return opencascade::hashBytes(aCombination, sizeof(aCombination));
0145   }
0146 };
0147 } // namespace std