HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_BVLeafIterator.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  */
7 
8 #ifndef __GU_BVLeafIterator_h__
9 #define __GU_BVLeafIterator_h__
10 
11 #include "GU_API.h"
12 #include "GU_DetailHandle.h"
13 #include <BV/BV_LeafIterator.h>
14 #include <UT/UT_DMatrix4.h>
15 #include <GA/GA_Iterator.h>
16 
17 class GA_PrimitiveGroup;
18 class GEO_Primitive;
19 class GU_Detail;
20 
21 /// Iterator for leaves to be enclosed by bounding volume. This iterator
22 /// fills each leaf with a single primitive.
23 /// Iterator retrieves info about each leaf:
24 /// - a set of vertices forming a bounding volume for the leaf
25 /// - barycenter (centroid) of primitive
27 {
28 public:
30 
31  explicit GU_BVLeafIterator(const GU_ConstDetailHandle &gdh,
32  const GA_PrimitiveGroup *group = 0);
33  explicit GU_BVLeafIterator(const GU_ConstDetailHandle &gdh,
34  const UT_DMatrix4 &transform,
35  const GA_PrimitiveGroup *group = 0);
36  explicit GU_BVLeafIterator(const GU_Detail &gdp,
37  const GA_PrimitiveGroup *group = 0);
38  explicit GU_BVLeafIterator(const GU_Detail &gdp,
39  const UT_DMatrix4 &transform,
40  const GA_PrimitiveGroup *group = 0);
41  virtual ~GU_BVLeafIterator();
42 
43 protected:
44  virtual void advanceSubclass();
45  virtual void jumpSubclass(int leafId);
46  virtual bool atEndSubclass() const;
47  virtual void rewindSubclass();
48  virtual int getLeafIdSubclass() const;
49 
50  virtual UT_Vector3 calcBarycenterSubclass() const;
51 
52  virtual void advanceVertexSubclass();
53  virtual bool atEndVertexSubclass() const;
54  virtual void rewindVertexSubclass();
55  virtual UT_Vector4 getVertexSubclass() const;
56 
57  virtual void setSkipDupVertsSubclass(bool flag);
58 private:
59  const GU_Detail &getGdp() const;
60 
61  const GEO_Primitive *getOurPrimitive() const;
62  const UT_DMatrix4 &getOurTransform() const;
63 
64  const GEO_Primitive *getPrimitiveByOffset(GA_Offset offset) const;
65 
66  /// Disallowed.
67  /// @{
69  GU_BVLeafIterator &operator=(const GU_BVLeafIterator &);
70  /// @}
71 
73  const GU_Detail &myGdp;
74  bool myHasTransform;
75  const UT_DMatrix4 myTransform;
76  const GA_PrimitiveGroup
77  *myGroup;
78  GA_Iterator myPrimIterator;
79  const GEO_Primitive *myPrim;
80  int myVertex;
81 
82  int *myDupArray;
83  int myDupId;
84 };
85 
86 #endif
virtual void jumpSubclass(int leafId)=0
BV_LeafIterator BaseClass
Iteration over a range of elements.
Definition: GA_Iterator.h:28
virtual int getLeafIdSubclass() const =0
virtual void advanceSubclass()=0
virtual UT_Vector3 calcBarycenterSubclass() const =0
virtual void rewindVertexSubclass()=0
virtual bool atEndSubclass() const =0
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual void advanceVertexSubclass()=0
GLintptr offset
Definition: glcorearb.h:664
#define GU_API
Definition: GU_API.h:12
GA_API const UT_StringHolder transform
virtual UT_Vector4 getVertexSubclass() const =0
virtual bool atEndVertexSubclass() const =0
virtual void setSkipDupVertsSubclass(bool flag)=0
png_infop png_uint_32 flag
Definition: png.h:2242
virtual void rewindSubclass()=0