HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RBD_SphereEdgeTree.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: RBD_SphereEdgeTree.h ( RBD Library, C++)
7  *
8  * COMMENTS:
9  * This builds a tree of spheres producing bounding
10  * information for an edge cloud.
11  */
12 
13 #ifndef __RBD_SphereEdgeTree_H__
14 #define __RBD_SphereEdgeTree_H__
15 
16 #include "RBD_API.h"
17 #include "RBD_SphereTree.h"
18 #include "RBD_Utils.h"
19 
20 #include <SIM/SIM_DataUtils.h>
21 #include <SIM/SIM_OptionsUser.h>
22 #include <GA/GA_Edge.h>
23 #include <UT/UT_Array.h>
24 #include <UT/UT_Set.h>
25 #include <UT/UT_Vector3Array.h>
26 
27 class SIM_Geometry;
28 class RBD_SphereEdgeTree;
29 
30 /// This describes an edge. The indices point to the sphere trees
31 /// point list.
33 {
34 public:
36 };
37 
38 /// This is a node in the sphere tree.
40 {
41 public:
43  const UT_Array<rbd_sphereedge> &edges);
44 
45  virtual ~RBD_SphereEdgeTreeNode();
46 
47  int64 getMemoryUsage() const;
48 
50 };
51 
52 /// This class holds an edge cloud of samples.
53 /// It has a bounding sphere hierarchy to allow quick rejection
54 /// when dealing with a SDF.
56 {
57 public:
58  /// Get the Tree.
59  virtual const RBD_SphereTreeNode *getRoot() const;
60 
61  /// Get a single point.
62  const UT_Vector3 &getPoint(int idx) const;
63 
64 protected:
65  // Determines if we convert to polygons or use raw points.
70 
71  explicit RBD_SphereEdgeTree(const SIM_DataFactory *factory);
72  virtual ~RBD_SphereEdgeTree();
73 
74  /// Overrides to properly implement this class as a SIM_Data.
75  /// This object is meant to be updated from the object's geometry at
76  /// each frame, so we only implement skeleton save, and load methods.
77  virtual void initializeSubclass();
78  virtual int64 getMemorySizeSubclass() const;
79  virtual bool getIsAlternateRepresentationSubclass() const;
80  virtual void initAlternateRepresentationSubclass(const SIM_Data &);
81 
82 private:
83  static const SIM_DopDescription *getSphereEdgeTreeDopDescription();
84 
85  /// This builds the sphere tree from the given GU_Detail.
86  void buildSphereEdgeTree(const SIM_Geometry *geo);
87 
88  /// Adds an edge to our list of edges. Tests to see if it
89  /// is already present by using the given hash table.
90  /// Return true if added.
91  bool addEdge(UT_Array<rbd_sphereedge> &edges,
93  GA_Index a, GA_Index b);
94  bool isDisabled(GA_Offset pt,
95  const GA_ROHandleF &attDisable) const;
96  RBD_SphereEdgeTreeNode *myRoot;
97  UT_Vector3Array myPoints;
98 
99  friend class RBD_SphereEdgeTreeNode;
100 
104  "Sphere Edge Tree",
105  getSphereEdgeTreeDopDescription());
106 };
107 
108 #endif
DECLARE_STANDARD_GETCASTTOTYPE()
Definition: UT_Set.h:58
#define GETSET_DATA_FUNCS_B(DataName, FuncName)
virtual bool getIsAlternateRepresentationSubclass() const
virtual int64 getMemorySizeSubclass() const
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
#define RBD_API
Definition: RBD_API.h:10
This is the base class for nodes inside sphere trees.
UT_Array< rbd_sphereedge > myEdges
#define RBD_NAME_ADDBARYCENTER
Definition: RBD_Utils.h:40
virtual const RBD_SphereTreeNode * getRoot() const =0
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
GA_Size GA_Offset
Definition: GA_Types.h:617
long long int64
Definition: SYS_Types.h:107
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
#define RBD_NAME_POLYLOD
Definition: RBD_Utils.h:39
#define GETSET_DATA_FUNCS_V2(DataName, FuncName)
This is a node in the sphere tree.
#define RBD_NAME_TRIANGULATE
Definition: RBD_Utils.h:41
#define RBD_NAME_POLYCONVERT
Definition: RBD_Utils.h:38
virtual void initAlternateRepresentationSubclass(const SIM_Data &)
virtual void initializeSubclass()