HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIPrimitiveRef.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_RTIPrimitiveRef.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_RTIPrimitiveRef i(geo, 32, GA_ATTRIB_VERTEX);
12  *
13  * The range of points used by primitive 14.
14  * GA_RTIPrimitiveRef 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. Behavior is undefined if vertices are added or removed
18  * during traversal.
19  */
20 
21 #ifndef __GA_RTIPrimitiveRef__
22 #define __GA_RTIPrimitiveRef__
23 
24 #include "GA_API.h"
25 #include "GA_RTISingle.h"
26 #include "GA_Types.h"
27 
28 
29 class GA_Detail;
30 class GA_IndexMap;
31 class GA_IteratorState;
32 class GA_Primitive;
33 class GA_Range;
35 
36 
38 {
39 public:
40  GA_RTIPrimitiveRef(const GA_Detail &geo, GA_Offset prim,
41  GA_AttributeOwner what);
43  ~GA_RTIPrimitiveRef() override;
44 
45  /// @{
46  /// RangeTypeInterface implementation
47  GA_RangeTypeInterface *copy() const override;
48  bool isSplittable() const override { return false; }
49  bool isEmpty() const override;
50  GA_Size getMaxEntries() const override;
51  GA_Size getEntries() const override;
52  bool split(GA_RangeTypeInterface *list[2]) const override;
53  bool isEqual(const GA_RangeTypeInterface &src) const override;
54  void iterateDestroy(GA_IteratorState &state) const override;
55  void iterateCopy(GA_IteratorState &dest,
56  const GA_IteratorState &src) const override;
57  GA_Size getPageCount() const override { return -1; }
58  bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
62  /// @}
63 private:
64  /// @{
65  /// RangeTypeInterface implementation
66  void singleRewind(GA_IteratorState &state) const override;
67  bool singleGet(const GA_IteratorState &state,
68  GA_Offset &value) const override;
69  void singleNext(GA_IteratorState &state) const override;
70  /// @}
71 
72  const GA_IndexMap &mySourceMap;
73  const GA_Primitive *myPrimPtr;
74  GA_Offset myPrimitive;
75  GA_AttributeOwner myTargetType;
76  bool myValid;
77 };
78 
79 #endif
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 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
virtual void iterateDestroy(GA_IteratorState &state) const
#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:235
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:641
bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
GA_Offset getFirstOffsetInPage(GA_Size) const override
Abstract implementation of a range.
virtual void singleNext(GA_IteratorState &state) const =0
GA_AttributeOwner
Definition: GA_Types.h:34
virtual GA_Size getMaxEntries() const =0
Get an upper bound on the size of the range.
virtual void singleRewind(GA_IteratorState &state) const =0
GA_Size getPageCount() const override
Container class for all geometry.
Definition: GA_Detail.h:96
Definition: core.h:1131
virtual GA_Size getEntries() const =0
Base class for ranges providing consolidation to contiguous blocks.
Definition: GA_RTISingle.h:31
bool isSplittable() const override
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1793