HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_RTIOrderedRange.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_RTIOrderedRange.h ( GA Library, C++)
7  *
8  * COMMENTS: This is an RTI class that sorts and orders another RTI for
9  * iteration or traversal.
10  */
11 
12 #ifndef __GA_RTIOrderedRange__
13 #define __GA_RTIOrderedRange__
14 
15 #include "GA_API.h"
16 #include "GA_OffsetList.h"
17 #include "GA_RTISingle.h"
18 #include "GA_Types.h"
19 
20 class GA_IteratorState;
21 class GA_Range;
23 
24 
26 {
27 public:
28  /// Iterate over the source range but in order.
29  /// @param descending If true, the index order is going to be in
30  /// a descending order. If false, it's ascending.
32  bool descending = false);
33 
34  /// Copy constructor
36 
37  /// Destructor
38  virtual ~GA_RTIOrderedRange();
39 
40  /// @{
41  /// RangeTypeInterface implementation
42  virtual GA_RangeTypeInterface *copy() const;
43  virtual bool isSplittable() const { return false; }
44  virtual bool isEmpty() const;
45  virtual GA_Size getMaxEntries() const;
46  virtual GA_Size getEntries() const;
47  virtual bool split(GA_RangeTypeInterface *list[2]) const;
48  virtual bool isEqual(const GA_RangeTypeInterface &src) const;
49  virtual void iterateCopy(GA_IteratorState &dest,
50  const GA_IteratorState &src) const;
51  virtual bool isOrdered() const;
52  virtual bool areTraversalDeletionsSafe() const { return true; }
53  virtual GA_Size getPageCount() const { return -1; }
54  virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
58  /// @}
59 
60 private:
61  /// @{
62  /// RangeTypeInterface implementation
63  virtual void singleRewind(GA_IteratorState &state) const;
64  virtual bool singleGet(const GA_IteratorState &state,
65  GA_Offset &value) const;
66  virtual void singleNext(GA_IteratorState &state) const;
67  /// @}
68 
69  /// Initialize the ordered range object.
70  void init(const GA_RangeTypeInterface &src,
71  bool descending = false);
72 
73  /// Finds an index that has a valid offset that is equal or greater
74  /// than the index given by the argument. Returns -1 if no such valid
75  /// index can be found.
76  GA_Size findValidOffsetIndexAtOrAfter(GA_Size index) const;
77 
78  /// The array that contains a permutation of offsets that orders
79  /// them according to the index
80  GA_OffsetList myOffsetOrder;
81 
82  /// The iteration step, usually +1 or -1 to indicate traversal direction.
83  int myStep;
84 };
85 
86 #endif
87 
virtual bool isEmpty() const =0
Check whether the range is empty.
virtual GA_RangeTypeInterface * copy() const =0
Method to create a copy of this selection.
virtual bool singleGet(const GA_IteratorState &state, GA_Offset &value) const =0
virtual void iterateCopy(GA_IteratorState &dest, const GA_IteratorState &src) const =0
Copy iterator state. The dest state will not have been constructed.
virtual bool split(GA_RangeTypeInterface *list[2]) const =0
int myStep
Definition: GT_CurveEval.h:264
virtual bool isOrdered() const
Query if the RTI is ordered according to the index.
virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
#define GA_API
Definition: GA_API.h:12
virtual bool isSplittable() const
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
A range of elements in an index-map.
Definition: GA_Range.h:42
bool getPageElementRangeNonSplittable() const
Method which can be called for getPageElementRange()
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual bool areTraversalDeletionsSafe() const
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
virtual GA_Offset getFirstOffsetInPage(GA_Size) const
Abstract implementation of a range.
virtual void singleNext(GA_IteratorState &state) const =0
virtual GA_Size getPageCount() const
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual GA_Size getMaxEntries() const =0
Get an upper bound on the size of the range.
virtual void singleRewind(GA_IteratorState &state) const =0
GLuint index
Definition: glcorearb.h:785
virtual GA_Size getEntries() const =0
Base class for ranges providing consolidation to contiguous blocks.
Definition: GA_RTISingle.h:31
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1792