Warning, /include/opencascade/BOPDS_IndexRange.lxx is written in an unsupported language. File is not indexed.
0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014
0015 //=================================================================================================
0016
0017 inline BOPDS_IndexRange::BOPDS_IndexRange()
0018 : myFirst(0),
0019 myLast(0)
0020 {
0021 }
0022
0023 //=================================================================================================
0024
0025 inline BOPDS_IndexRange::BOPDS_IndexRange(const int theI1, const int theI2)
0026 : myFirst(theI1),
0027 myLast(theI2)
0028 {
0029 }
0030
0031 //=================================================================================================
0032
0033 inline void BOPDS_IndexRange::SetFirst(const int aFirst)
0034 {
0035 myFirst = aFirst;
0036 }
0037
0038 //=================================================================================================
0039
0040 inline int BOPDS_IndexRange::First() const
0041 {
0042 return myFirst;
0043 }
0044
0045 //=================================================================================================
0046
0047 inline void BOPDS_IndexRange::SetLast(const int aLast)
0048 {
0049 myLast = aLast;
0050 }
0051
0052 //=================================================================================================
0053
0054 inline int BOPDS_IndexRange::Last() const
0055 {
0056 return myLast;
0057 }
0058
0059 //=================================================================================================
0060
0061 inline void BOPDS_IndexRange::SetIndices(const int theI1, const int theI2)
0062 {
0063 myFirst = theI1;
0064 myLast = theI2;
0065 }
0066
0067 //=================================================================================================
0068
0069 inline void BOPDS_IndexRange::Indices(int& theI1, int& theI2) const
0070 {
0071 theI1 = myFirst;
0072 theI2 = myLast;
0073 }
0074
0075 //=================================================================================================
0076
0077 inline bool BOPDS_IndexRange::Contains(const int aIndex) const
0078 {
0079 return aIndex >= myFirst && aIndex <= myLast;
0080 }