HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIPrimitiveComprehension.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_RTIPrimitiveComprehension.h ( GA Library, C++)
7  *
8  * COMMENTS: Define the range of points or vertices referenced by a primitive
9  *
10  * The range of vertices owned by primitive 32
11  * GA_RTIPrimitiveComprehension i(geo, 32, GA_ATTRIB_VERTEX);
12  *
13  * The range of points used by primitive 14.
14  * GA_RTIPrimitiveComprehension i(geo, 14, GA_ATTRIB_POINT);
15  *
16  * If a primitive refers to a point more than once, the point will be visited
17  * multiple times.
18  */
19 
20 #ifndef __GA_RTIPrimitiveComprehension__
21 #define __GA_RTIPrimitiveComprehension__
22 
23 #include "GA_API.h"
24 #include "GA_RTISingle.h"
25 #include "GA_OffsetList.h"
26 #include "GA_Types.h"
27 
28 
29 class GA_Detail;
30 class GA_IteratorState;
31 class GA_Range;
33 
34 
35 /// @brief Range of all points/vertices accessed by a range of primitives
36 ///
37 /// @note This allocates an offset list of all elements.
39 {
40 public:
41  /// Specify true for @c keep_prim_order if you need the points/vertices
42  /// to be delivered in the order they're traversed by @c primlist.
44  const GA_Range &primlist,
45  GA_AttributeOwner what,
46  bool keep_prim_order);
50  ~GA_RTIPrimitiveComprehension() override;
51 
52  /// @{
53  /// RangeTypeInterface implementation
54  GA_RangeTypeInterface *copy() const override;
55  bool isSplittable() const override { return false; }
56  bool isEmpty() const override;
57  GA_Size getMaxEntries() const override;
58  GA_Size getEntries() const override;
59  bool split(GA_RangeTypeInterface *list[2]) const override;
60  bool isEqual(const GA_RangeTypeInterface &src) const override;
61  void iterateCopy(GA_IteratorState &dest,
62  const GA_IteratorState &src) const override;
63  bool areTraversalDeletionsSafe() const override { return true; }
64  GA_Size getPageCount() const override { return -1; }
65  bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
69  /// @}
70 private:
71  /// @{
72  /// RangeTypeInterface implementation
73  void singleRewind(GA_IteratorState &state) const override;
74  bool singleGet(const GA_IteratorState &state,
75  GA_Offset &value) const override;
76  void singleNext(GA_IteratorState &state) const override;
77  /// @}
78 
79  GA_OffsetList myOffsets;
80  GA_AttributeOwner myTargetType;
81 };
82 
83 #endif
virtual bool isEmpty() const =0
Check whether the range is empty.
bool areTraversalDeletionsSafe() const override
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
bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
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:475
#define GA_API
Definition: GA_API.h:14
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:236
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:646
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
GLuint GLuint end
Definition: glcorearb.h:475
Abstract implementation of a range.
Range of all points/vertices accessed by a range of primitives.
virtual void singleNext(GA_IteratorState &state) const =0
GA_AttributeOwner
Definition: GA_Types.h:35
virtual GA_Size getMaxEntries() const =0
Get an upper bound on the size of the range.
virtual void singleRewind(GA_IteratorState &state) const =0
Container class for all geometry.
Definition: GA_Detail.h:96
GA_Offset getFirstOffsetInPage(GA_Size) const override
Definition: core.h:1131
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:1793