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  ~SIM_BVLeafIterator() override;
35 
36 protected:
37  void advanceSubclass() override;
38  void jumpSubclass(int leafId) override;
39  bool atEndSubclass() const override;
40  void rewindSubclass() override;
41  int getLeafIdSubclass() const override;
42 
43  UT_Vector3 calcBarycenterSubclass() const override;
44 
45  void advanceVertexSubclass() override;
46  bool atEndVertexSubclass() const override;
47  void rewindVertexSubclass() override;
48  UT_Vector4 getVertexSubclass() const override;
49 
50  void setSkipDupVertsSubclass(bool flag) override;
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:12
BV_LeafIterator BaseClass
virtual void setSkipDupVertsSubclass(bool flag)=0
virtual void rewindSubclass()=0