HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIIndex.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_RTIIndex.h ( GA Library, C++)
7  *
8  * COMMENTS: This is like the "Python" range function. That is, the end is
9  * non-inclusive:
10  * GA_RTIIndex(list, 0, 3) = [0, 1, 2]
11  */
12 
13 #ifndef __GA_RTIIndex__
14 #define __GA_RTIIndex__
15 
16 #include "GA_API.h"
17 #include "GA_RTISingle.h"
18 #include "GA_Types.h"
19 
20 
21 class GA_IndexMap;
22 class GA_IteratorState;
23 class GA_Range;
25 
26 
28 {
29 public:
30  /// Iterate over the entire range of elements (in order)
31  GA_RTIIndex(GA_IndexMap &list);
32  GA_RTIIndex(const GA_IndexMap &list);
33 
34  /// Specify a single element by index
35  GA_RTIIndex(GA_IndexMap &list, GA_Index singleton);
36  GA_RTIIndex(const GA_IndexMap &list, GA_Index singleton);
37 
38  /// Iterate over a range of elements, passing a negative step will iterate
39  /// backward over the range (in this case end should be < start).
41  GA_Size step=1);
42  GA_RTIIndex(const GA_IndexMap &list, GA_Index start, GA_Index end,
43  GA_Size step=1);
44 
45  /// Copy constructor
46  GA_RTIIndex(const GA_RTIIndex &src);
47 
48  /// Destructor
49  virtual ~GA_RTIIndex();
50 
51  /// @{
52  /// RangeTypeInterface implementation
53  virtual GA_RangeTypeInterface *copy() const;
54  virtual bool isSplittable() const { return false; }
55  virtual bool isEmpty() const;
56  virtual GA_Size getMaxEntries() const;
57  virtual GA_Size getEntries() const;
58  virtual bool split(GA_RangeTypeInterface *list[2]) const;
59  virtual bool isEqual(const GA_RangeTypeInterface &src) const;
60  virtual void iterateCopy(GA_IteratorState &dest,
61  const GA_IteratorState &src) const;
62  virtual void iterateRewind(GA_IteratorState &state,
63  GA_Offset &start, GA_Offset &end) const;
64  virtual void iterateNext(GA_IteratorState &state,
65  GA_Offset &start, GA_Offset &end) const;
66  virtual bool isOrdered() const;
67  virtual bool areTraversalDeletionsSafe() const { return true; }
68  virtual bool canContainDuplicates() const { return false; }
69  virtual GA_Size getPageCount() const { return -1; }
70  virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
74  /// @}
75 
76 private:
77  /// @{
78  /// RangeTypeInterface implementation
79  virtual void singleRewind(GA_IteratorState &state) const;
80  virtual bool singleGet(const GA_IteratorState &state,
81  GA_Offset &value) const;
82  virtual void singleNext(GA_IteratorState &state) const;
83  /// @}
84  void init(GA_Size start, GA_Size end, GA_Size step);
85 
86  GA_Index myStart, myEnd;
88 };
89 
90 #endif
91 
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
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 GA_Offset getFirstOffsetInPage(GA_Size) const
Definition: GA_RTIIndex.h:72
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
GLuint start
Definition: glcorearb.h:474
int myStep
Definition: GT_CurveEval.h:264
virtual bool isOrdered() const
Query if the RTI is ordered according to the index.
#define GA_API
Definition: GA_API.h:12
virtual bool canContainDuplicates() const
Definition: GA_RTIIndex.h:68
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
virtual void iterateRewind(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
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
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
GLuint GLuint end
Definition: glcorearb.h:474
virtual void iterateNext(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
virtual bool isSplittable() const
Definition: GA_RTIIndex.h:54
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
Abstract implementation of a range.
virtual void singleNext(GA_IteratorState &state) const =0
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
virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
Definition: GA_RTIIndex.h:70
virtual GA_Size getPageCount() const
Definition: GA_RTIIndex.h:69
virtual GA_Size getEntries() const =0
Base class for ranges providing consolidation to contiguous blocks.
Definition: GA_RTISingle.h:31
virtual bool areTraversalDeletionsSafe() const
Definition: GA_RTIIndex.h:67
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1792