HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIOffset.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_RTIOffset.h ( GA Library, C++)
7  *
8  * COMMENTS: This is like the "Python" range function. That is, the end is
9  * non-inclusive:
10  * GA_RTIOffset(list, 0, 3) = [0, 1, 2]
11  */
12 
13 #ifndef __GA_RTIOffset__
14 #define __GA_RTIOffset__
15 
16 #include "GA_API.h"
17 #include "GA_RangeTypeInterface.h"
18 #include "GA_Types.h"
19 
20 
21 class GA_IndexMap;
22 class GA_IteratorState;
23 class GA_Range;
25 
26 
27 /// Including temporaries will also include temporary vertex/point indices in
28 /// the range. Most ranges are only interested in the visible elements.
29 /// However, some operations need to be applied to *all* elements.
30 template <bool IncludeTemporaries>
32 {
33 public:
34  // Range containing the entire range of the element list
35  GA_RTIOffset_T(const GA_IndexMap &list);
36 
37  // Range containing a single element
38  GA_RTIOffset_T(const GA_IndexMap &list, GA_Offset singleton);
39 
40  // Range of a subset of elements
42 
43  // Copy c-tor
45 
46  ~GA_RTIOffset_T() override;
47 
48  /// @{
49  /// RangeTypeInterface implementation
50  GA_RangeTypeInterface *copy() const override;
51  bool isSplittable() const override { return true; }
52  bool isEmpty() const override;
53  GA_Size getMaxEntries() const override;
54  GA_Size getEntries() const override;
55  bool split(GA_RangeTypeInterface *list[2]) const override;
56  bool isEqual(const GA_RangeTypeInterface &src) const override;
57  void iterateCopy(GA_IteratorState &dest,
58  const GA_IteratorState &src) const override;
59  void iterateRewind(GA_IteratorState &state,
60  GA_Offset &start, GA_Offset &end) const override;
61  void iterateNext(GA_IteratorState &state,
62  GA_Offset &start, GA_Offset &end) const override;
63  bool isOrdered() const override { return true; }
64  bool areTraversalDeletionsSafe() const override { return true; }
65  bool canContainDuplicates() const override { return false; }
66  const GA_RangeMemberQuery *allocMemberQuery() const override;
67 
68  GA_Size getPageCount() const override;
70  GA_Size relative_page, GA_Size npages) const override;
71  GA_Offset getFirstOffsetInPage(GA_Size relative_page) const override;
72  /// @}
73 
74 private:
75  void init(GA_Size start, GA_Size end);
76  void extractRange(GA_Offset &curr,
77  GA_Offset &start, GA_Offset &end) const;
78 
79  // State information
80  GA_Offset myStart, myEnd;
81  GA_Size myComputedSize;
82 };
83 
86 
87 #endif
bool isSplittable() const override
Definition: GA_RTIOffset.h:51
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
GLenum GLint * range
Definition: glcorearb.h:1925
GLuint start
Definition: glcorearb.h:475
bool getPageElementRange(GA_Range &range, GA_Size relative_page, GA_Size npages) const override
bool split(GA_RangeTypeInterface *list[2]) const override
bool isOrdered() const override
Definition: GA_RTIOffset.h:63
Abstract base class for a range membership query object.
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:236
GA_RangeTypeInterface * copy() const override
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_RTIOffset_T< false > GA_RTIOffset
Definition: GA_RTIOffset.h:84
GA_Size GA_Offset
Definition: GA_Types.h:646
GLuint GLuint end
Definition: glcorearb.h:475
void iterateRewind(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
void iterateNext(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
~GA_RTIOffset_T() override
Abstract implementation of a range.
GA_RTIOffset_T(const GA_IndexMap &list)
bool isEmpty() const override
bool isEqual(const GA_RangeTypeInterface &src) const override
GA_Offset getFirstOffsetInPage(GA_Size relative_page) const override
GA_Size getMaxEntries() const override
const GA_RangeMemberQuery * allocMemberQuery() const override
GA_Size getEntries() const override
GA_RTIOffset_T< true > GA_RTIOffsetComplete
Definition: GA_RTIOffset.h:85
void iterateCopy(GA_IteratorState &dest, const GA_IteratorState &src) const override
GA_Size getPageCount() const override
bool canContainDuplicates() const override
Definition: GA_RTIOffset.h:65
GLenum src
Definition: glcorearb.h:1793
bool areTraversalDeletionsSafe() const override
Definition: GA_RTIOffset.h:64