HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIPointRef.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_RTIPointRef.h ( GA Library, C++)
7  *
8  * COMMENTS: Iterate over elements which connect to a point.
9  *
10  * The selection of all vertices which reference point number 32
11  * GA_RTIPointRef i(geo, 32, GA_ATTRIB_VERTEX);
12  *
13  * The selection of all primitives which reference point number 14
14  * GA_RTIPointRef i(geo, 14, GA_ATTRIB_PRIMITIVE);
15  *
16  * If a primitive refers to a point more than once, the primitive will be
17  * visited multiple times.
18  */
19 
20 #ifndef __GA_RangePoints__
21 #define __GA_RangePoints__
22 
23 #include "GA_API.h"
24 #include "GA_RTISingle.h"
25 #include "GA_Types.h"
26 
27 
28 class GA_Detail;
29 class GA_IndexMap;
30 class GA_IteratorState;
31 class GA_Range;
33 
34 
35 /// @brief Specify range of elements (vertex, primitive) that reference a point
36 ///
37 /// This specifies a range of elements which reference a given point. For
38 /// example, the range of all vertices which reference a point or the range of
39 /// all primitives which reference a point.
41 {
42 public:
43  /// Define the range. The @c owner parameter defines what type elements
44  /// are in the range. This should be either GA_ATTRIB_VERTEX or
45  /// GA_ATTRIB_PRIMITIVE. The @c point parameter specifies the point of
46  /// interest. The @c geo parameter specifies the source ot the geometry.
47  /// For example, to iterate over all the vertices which reference point 32
48  /// @code
49  /// GA_RTIPointRef(geo, 32, GA_ATTRIB_VERTEX);
50  /// @endcode
51  GA_RTIPointRef(const GA_Detail &geo, GA_Offset point, GA_AttributeOwner owner);
52  /// Copy constructor
53  GA_RTIPointRef( const GA_RTIPointRef &i );
54  /// Destructor
55  ~GA_RTIPointRef() override;
56 
57  /// Point iterators may not work unless the topological attributes exist.
58  bool isValid() const;
59 
60  /// @{
61  /// RangeTypeInterface implementation
62  GA_RangeTypeInterface *copy() const override;
63  bool isSplittable() const override { return false; }
64  bool isEmpty() const override;
65  GA_Size getMaxEntries() const override;
66  GA_Size getEntries() const override;
67  bool split(GA_RangeTypeInterface *list[2]) const override;
68  bool isEqual(const GA_RangeTypeInterface &src) const override;
69  void iterateCopy(GA_IteratorState &dest,
70  const GA_IteratorState &src) const override;
71  GA_Size getPageCount() const override { return -1; }
72  bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
76  /// @}
77 
78 private:
79  /// @{
80  /// RangeTypeInterface implementation
81  void singleRewind(GA_IteratorState &state) const override;
82  bool singleGet(const GA_IteratorState &state,
83  GA_Offset &value) const override;
84  void singleNext(GA_IteratorState &state) const override;
85  /// @}
86  const GA_IndexMap &mySourceMap;
87  GA_Offset myPoint;
88  GA_AttributeOwner myTargetType;
89  GA_Size myComputedSize;
90 };
91 
92 #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.
bool isSplittable() 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
virtual void iterateCopy(GA_IteratorState &dest, const GA_IteratorState &src) const =0
Copy iterator state. The dest state will not have been constructed.
GA_Size getPageCount() const override
bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const override
virtual bool split(GA_RangeTypeInterface *list[2]) const =0
#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()
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: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
Definition: core.h:1131
virtual GA_Size getEntries() const =0
Base class for ranges providing consolidation to contiguous blocks.
Definition: GA_RTISingle.h:31
Specify range of elements (vertex, primitive) that reference a point.
virtual bool isEqual(const GA_RangeTypeInterface &src) const =0
GLenum src
Definition: glcorearb.h:1793