Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
IntTools_MarkedRangeSet Class Reference

class MarkedRangeSet provides continuous set of ranges marked with flags More...

#include <IntTools_MarkedRangeSet.hxx>

Public Member Functions

 IntTools_MarkedRangeSet ()
 Empty constructor.
 
 IntTools_MarkedRangeSet (const double theFirstBoundary, const double theLastBoundary, const int theInitFlag)
 build set of ranges which consists of one range with boundary values theFirstBoundary and theLastBoundary
 
 IntTools_MarkedRangeSet (const NCollection_Array1< double > &theSortedArray, const int theInitFlag)
 Build set of ranges based on the array of progressive sorted values.
 
void SetBoundaries (const double theFirstBoundary, const double theLastBoundary, const int theInitFlag)
 build set of ranges which consists of one range with boundary values theFirstBoundary and theLastBoundary
 
void SetRanges (const NCollection_Array1< double > &theSortedArray, const int theInitFlag)
 Build set of ranges based on the array of progressive sorted values.
 
bool InsertRange (const double theFirstBoundary, const double theLastBoundary, const int theFlag)
 Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.
 
bool InsertRange (const IntTools_Range &theRange, const int theFlag)
 Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.
 
bool InsertRange (const double theFirstBoundary, const double theLastBoundary, const int theFlag, const int theIndex)
 Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. The index theIndex is a position where the range will be inserted. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.
 
bool InsertRange (const IntTools_Range &theRange, const int theFlag, const int theIndex)
 Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. The index theIndex is a position where the range will be inserted. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.
 
void SetFlag (const int theIndex, const int theFlag)
 Set flag theFlag for range with index theIndex.
 
int Flag (const int theIndex) const
 Returns flag of the range with index theIndex.
 
int GetIndex (const double theValue) const
 Returns index of range which contains theValue. If theValue do not belong any range returns 0.
 
const NCollection_Sequence< int > & GetIndices (const double theValue)
 
int GetIndex (const double theValue, const bool UseLower) const
 Returns index of range which contains theValue If theValue do not belong any range returns 0. If UseLower is true then lower boundary of the range can be equal to theValue, otherwise upper boundary of the range can be equal to theValue.
 
int Length () const
 Returns number of ranges.
 
IntTools_Range Range (const int theIndex) const
 Returns the range with index theIndex. the Index can be from 1 to Length()
 

Detailed Description

class MarkedRangeSet provides continuous set of ranges marked with flags

Constructor & Destructor Documentation

◆ IntTools_MarkedRangeSet() [1/3]

IntTools_MarkedRangeSet::IntTools_MarkedRangeSet ( )

Empty constructor.

◆ IntTools_MarkedRangeSet() [2/3]

IntTools_MarkedRangeSet::IntTools_MarkedRangeSet ( const double theFirstBoundary,
const double theLastBoundary,
const int theInitFlag )

build set of ranges which consists of one range with boundary values theFirstBoundary and theLastBoundary

◆ IntTools_MarkedRangeSet() [3/3]

IntTools_MarkedRangeSet::IntTools_MarkedRangeSet ( const NCollection_Array1< double > & theSortedArray,
const int theInitFlag )

Build set of ranges based on the array of progressive sorted values.

Warning: The constructor do not check if the values of array are not sorted It should be checked before function invocation

Member Function Documentation

◆ Flag()

int IntTools_MarkedRangeSet::Flag ( const int theIndex) const

Returns flag of the range with index theIndex.

◆ GetIndex() [1/2]

int IntTools_MarkedRangeSet::GetIndex ( const double theValue) const

Returns index of range which contains theValue. If theValue do not belong any range returns 0.

◆ GetIndex() [2/2]

int IntTools_MarkedRangeSet::GetIndex ( const double theValue,
const bool UseLower ) const

Returns index of range which contains theValue If theValue do not belong any range returns 0. If UseLower is true then lower boundary of the range can be equal to theValue, otherwise upper boundary of the range can be equal to theValue.

◆ GetIndices()

const NCollection_Sequence< int > & IntTools_MarkedRangeSet::GetIndices ( const double theValue)

◆ InsertRange() [1/4]

bool IntTools_MarkedRangeSet::InsertRange ( const double theFirstBoundary,
const double theLastBoundary,
const int theFlag )

Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.

◆ InsertRange() [2/4]

bool IntTools_MarkedRangeSet::InsertRange ( const double theFirstBoundary,
const double theLastBoundary,
const int theFlag,
const int theIndex )

Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. The index theIndex is a position where the range will be inserted. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.

◆ InsertRange() [3/4]

bool IntTools_MarkedRangeSet::InsertRange ( const IntTools_Range & theRange,
const int theFlag )

Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.

◆ InsertRange() [4/4]

bool IntTools_MarkedRangeSet::InsertRange ( const IntTools_Range & theRange,
const int theFlag,
const int theIndex )

Inserts a new range marked with flag theFlag It replace the existing ranges or parts of ranges and their flags. The index theIndex is a position where the range will be inserted. Returns True if the range is inside the initial boundaries, otherwise or in case of some error returns False.

◆ Length()

int IntTools_MarkedRangeSet::Length ( ) const
inline

Returns number of ranges.

◆ Range()

IntTools_Range IntTools_MarkedRangeSet::Range ( const int theIndex) const

Returns the range with index theIndex. the Index can be from 1 to Length()

◆ SetBoundaries()

void IntTools_MarkedRangeSet::SetBoundaries ( const double theFirstBoundary,
const double theLastBoundary,
const int theInitFlag )

build set of ranges which consists of one range with boundary values theFirstBoundary and theLastBoundary

◆ SetFlag()

void IntTools_MarkedRangeSet::SetFlag ( const int theIndex,
const int theFlag )

Set flag theFlag for range with index theIndex.

◆ SetRanges()

void IntTools_MarkedRangeSet::SetRanges ( const NCollection_Array1< double > & theSortedArray,
const int theInitFlag )

Build set of ranges based on the array of progressive sorted values.

Warning: The function do not check if the values of array are not sorted It should be checked before function invocation


The documentation for this class was generated from the following file: