HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_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 __SIM_BVLeafIterator_h__
9 #define __SIM_BVLeafIterator_h__
10 
11 #include "SIM_API.h"
12 #include <BV/BV_LeafIterator.h>
13 #include <UT/UT_DMatrix4.h>
14 
16 
17 /// Iterator for leaves to be enclosed by bounding volume. This iterator
18 /// fills each leaf with a single primitive.
19 /// Iterator retrieves info about each leaf:
20 /// - a set of vertices forming a bounding volume for the leaf
21 /// - barycenter (centroid) of primitive
23 {
24 public:
26 
27  explicit SIM_BVLeafIterator(const SIM_TriangulatedGeometry *tgeo,
28  const UT_DMatrix4 &begxform,
29  const UT_DMatrix4 &endxform,
30  bool startPosOnly = false);
31  explicit SIM_BVLeafIterator(const SIM_TriangulatedGeometry *tgeo,
32  const UT_DMatrix4 &endxform,
33  bool startPosOnly = false);
34  virtual ~SIM_BVLeafIterator();
35 
36 protected:
37  virtual void advanceSubclass();
38  virtual void jumpSubclass(int leafId);
39  virtual bool atEndSubclass() const;
40  virtual void rewindSubclass();
41  virtual int getLeafIdSubclass() const;
42 
43  virtual UT_Vector3 calcBarycenterSubclass() const;
44 
45  virtual void advanceVertexSubclass();
46  virtual bool atEndVertexSubclass() const;
47  virtual void rewindVertexSubclass();
48  virtual UT_Vector4 getVertexSubclass() const;
49 
50  virtual void setSkipDupVertsSubclass(bool flag);
51 
52 
53 private:
54  const SIM_TriangulatedGeometry *myTgeo;
55  const UT_DMatrix4 myBegxform, myEndxform;
56  int myPrim;
57  int myVertex;
58 
59  int *myDupArray;
60  int myDupId;
61  bool myEndFlag, myStartPosOnly;
62 };
63 
64 #endif
virtual void jumpSubclass(int leafId)=0
virtual int getLeafIdSubclass() const =0
virtual void advanceSubclass()=0
virtual UT_Vector3 calcBarycenterSubclass() const =0
virtual void rewindVertexSubclass()=0
virtual bool atEndSubclass() const =0
virtual void advanceVertexSubclass()=0
virtual UT_Vector4 getVertexSubclass() const =0
virtual bool atEndVertexSubclass() const =0
#define SIM_API
Definition: SIM_API.h:10
BV_LeafIterator BaseClass
virtual void setSkipDupVertsSubclass(bool flag)=0
png_infop png_uint_32 flag
Definition: png.h:2242
virtual void rewindSubclass()=0