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
54  /// Destructor
55  virtual ~GA_RTIPointRef();
56 
57  /// Point iterators may not work unless the topological attributes exist.
58  bool isValid() const;
59 
60  /// @{
61  /// RangeTypeInterface implementation
62  virtual GA_RangeTypeInterface *copy() const;
63  virtual bool isSplittable() const { return false; }
64  virtual bool isEmpty() const;
65  virtual GA_Size getMaxEntries() const;
66  virtual GA_Size getEntries() const;
67  virtual bool split(GA_RangeTypeInterface *list[2]) const;
68  virtual bool isEqual(const GA_RangeTypeInterface &src) const;
69  virtual void iterateCopy(GA_IteratorState &dest,
70  const GA_IteratorState &src) const;
71  virtual GA_Size getPageCount() const { return -1; }
72  virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
76  /// @}
77 
78 private:
79  /// @{
80  /// RangeTypeInterface implementation
81  virtual void singleRewind(GA_IteratorState &state) const;
82  virtual bool singleGet(const GA_IteratorState &state,
83  GA_Offset &value) const;
84  virtual void singleNext(GA_IteratorState &state) const;
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.
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 GA_Offset getFirstOffsetInPage(GA_Size) const
virtual bool split(GA_RangeTypeInterface *list[2]) const =0
virtual bool getPageElementRange(GA_Range &, GA_Size, GA_Size) const
#define GA_API
Definition: GA_API.h:12
png_uint_32 i
Definition: png.h:2877
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
bool getPageElementRangeNonSplittable() const
Method which can be called for getPageElementRange()
GA_Size GA_Offset
Definition: GA_Types.h:617
GA_Offset getFirstOffsetInPageNonSplittable() const
Method which can be called for getFirstOffsetInPage()
Abstract implementation of a range.
virtual void singleNext(GA_IteratorState &state) const =0
virtual bool isSplittable() const
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GA_AttributeOwner
Definition: GA_Types.h:33
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:95
virtual GA_Size getPageCount() const
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:1792