00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __RBD_SphereEdgeTree_H__
00022 #define __RBD_SphereEdgeTree_H__
00023
00024 #include "RBD_API.h"
00025 #include <UT/UT_Vector3Array.h>
00026 #include <UT/UT_RefArray.h>
00027 #include <SIM/SIM_DataUtils.h>
00028 #include <SIM/SIM_OptionsUser.h>
00029
00030 #include "RBD_Utils.h"
00031 #include "RBD_SphereTree.h"
00032
00033 class UT_HashTable;
00034 class SIM_Geometry;
00035 class RBD_SphereEdgeTree;
00036
00037
00038
00039 class RBD_API rbd_sphereedge
00040 {
00041 public:
00042 int a, b;
00043 };
00044
00045
00046 class RBD_API RBD_SphereEdgeTreeNode : public RBD_SphereTreeNode
00047 {
00048 public:
00049 RBD_SphereEdgeTreeNode(RBD_SphereEdgeTree *tree,
00050 const UT_RefArray<rbd_sphereedge> &edges);
00051
00052 virtual ~RBD_SphereEdgeTreeNode();
00053
00054 int64 getMemoryUsage() const;
00055
00056 UT_RefArray<rbd_sphereedge> myEdges;
00057 };
00058
00059
00060
00061
00062 class RBD_API RBD_SphereEdgeTree : public RBD_SphereTree, public SIM_OptionsUser
00063 {
00064 public:
00065
00066 virtual const RBD_SphereTreeNode *getRoot() const;
00067
00068
00069 const UT_Vector3 &getPoint(int idx) const;
00070
00071 protected:
00072
00073 GETSET_DATA_FUNCS_B(RBD_NAME_POLYCONVERT, PolyConvert);
00074 GETSET_DATA_FUNCS_B(RBD_NAME_TRIANGULATE, Triangulate);
00075 GETSET_DATA_FUNCS_V2(RBD_NAME_POLYLOD, PolyLOD);
00076 GETSET_DATA_FUNCS_B(RBD_NAME_ADDBARYCENTER, AddBaryCenter);
00077
00078 explicit RBD_SphereEdgeTree(const SIM_DataFactory *factory);
00079 virtual ~RBD_SphereEdgeTree();
00080
00081
00082
00083
00084 virtual void initializeSubclass();
00085 virtual int64 getMemorySizeSubclass() const;
00086 virtual bool getIsAlternateRepresentationSubclass() const;
00087 virtual void initAlternateRepresentationSubclass(const SIM_Data &);
00088
00089 private:
00090 static const SIM_DopDescription *getSphereEdgeTreeDopDescription();
00091
00092
00093 void buildSphereEdgeTree(const SIM_Geometry *geo);
00094
00095
00096
00097
00098 bool addEdge(UT_RefArray<rbd_sphereedge> &edges,
00099 UT_HashTable &hash,
00100 int a, int b);
00101 bool isDisabled(const GEO_Point *pt,
00102 const GB_AttributeRef &attDisable,
00103 const GB_AttributeRef &attDisableF) const;
00104 RBD_SphereEdgeTreeNode *myRoot;
00105 UT_Vector3Array myPoints;
00106
00107 friend class RBD_SphereEdgeTreeNode;
00108
00109 DECLARE_STANDARD_GETCASTTOTYPE();
00110 DECLARE_DATAFACTORY(RBD_SphereEdgeTree,
00111 RBD_SphereTree,
00112 "Sphere Edge Tree",
00113 getSphereEdgeTreeDopDescription());
00114 };
00115
00116 #endif