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  ~RBD_SphereEdgeTreeNode() override;
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  const RBD_SphereTreeNode *getRoot() const override;
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  ~RBD_SphereEdgeTree() override;
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  void initializeSubclass() override;
78  int64 getMemorySizeSubclass() const override;
79  bool getIsAlternateRepresentationSubclass() const override;
81  const SIM_Data &) override;
82 
83 private:
84  static const SIM_DopDescription *getSphereEdgeTreeDopDescription();
85 
86  /// This builds the sphere tree from the given GU_Detail.
87  void buildSphereEdgeTree(const SIM_Geometry *geo);
88 
89  /// Adds an edge to our list of edges. Tests to see if it
90  /// is already present by using the given hash table.
91  /// Return true if added.
92  bool addEdge(UT_Array<rbd_sphereedge> &edges,
94  GA_Index a, GA_Index b);
95  bool isDisabled(GA_Offset pt,
96  const GA_ROHandleF &attDisable) const;
98  UT_Vector3Array myPoints;
99 
101 
105  "Sphere Edge Tree",
106  getSphereEdgeTreeDopDescription());
107 };
108 
109 #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:1222
#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:63
GA_Size GA_Offset
Definition: GA_Types.h:646
long long int64
Definition: SYS_Types.h:116
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:640
#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 &)
myRoot
Definition: UT_RTreeImpl.h:716
virtual void initializeSubclass()