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  virtual ~GA_RTIOffset_T();
47 
48  /// @{
49  /// RangeTypeInterface implementation
50  virtual GA_RangeTypeInterface *copy() const;
51  virtual bool isSplittable() const { return true; }
52  virtual bool isEmpty() const;
53  virtual GA_Size getMaxEntries() const;
54  virtual GA_Size getEntries() const;
55  virtual bool split(GA_RangeTypeInterface *list[2]) const;
56  virtual bool isEqual(const GA_RangeTypeInterface &src) const;
57  virtual void iterateCopy(GA_IteratorState &dest,
58  const GA_IteratorState &src) const;
59  virtual void iterateRewind(GA_IteratorState &state,
60  GA_Offset &start, GA_Offset &end) const;
61  virtual void iterateNext(GA_IteratorState &state,
62  GA_Offset &start, GA_Offset &end) const;
63  virtual bool isOrdered() const { return true; }
64  virtual bool areTraversalDeletionsSafe() const { return true; }
65  virtual bool canContainDuplicates() const { return false; }
66  virtual const GA_RangeMemberQuery *allocMemberQuery() const;
67 
68  virtual GA_Size getPageCount() const;
69  virtual bool getPageElementRange(GA_Range &range,
70  GA_Size relative_page, GA_Size npages) const;
71  virtual GA_Offset getFirstOffsetInPage(GA_Size relative_page) const;
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
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
virtual void iterateRewind(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
GLenum GLint * range
Definition: glcorearb.h:1924
virtual bool isEqual(const GA_RangeTypeInterface &src) const
virtual GA_Offset getFirstOffsetInPage(GA_Size relative_page) const
virtual bool getPageElementRange(GA_Range &range, GA_Size relative_page, GA_Size npages) const
GLuint start
Definition: glcorearb.h:474
virtual bool canContainDuplicates() const
Definition: GA_RTIOffset.h:65
Abstract base class for a range membership query object.
virtual const GA_RangeMemberQuery * allocMemberQuery() 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
GA_RTIOffset_T< false > GA_RTIOffset
Definition: GA_RTIOffset.h:84
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual void iterateNext(GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const
virtual bool isOrdered() const
Definition: GA_RTIOffset.h:63
virtual ~GA_RTIOffset_T()
virtual bool isSplittable() const
Definition: GA_RTIOffset.h:51
GLuint GLuint end
Definition: glcorearb.h:474
virtual GA_Size getMaxEntries() const
virtual GA_Size getPageCount() const
Abstract implementation of a range.
GA_RTIOffset_T(const GA_IndexMap &list)
virtual GA_Size getEntries() const
virtual bool areTraversalDeletionsSafe() const
Definition: GA_RTIOffset.h:64
virtual GA_RangeTypeInterface * copy() const
virtual void iterateCopy(GA_IteratorState &dest, const GA_IteratorState &src) const
GA_RTIOffset_T< true > GA_RTIOffsetComplete
Definition: GA_RTIOffset.h:85
virtual bool isEmpty() const
virtual bool split(GA_RangeTypeInterface *list[2]) const
GLenum src
Definition: glcorearb.h:1792