00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __BV_LeafIterator_h__
00020 #define __BV_LeafIterator_h__
00021
00022 #include "BV_API.h"
00023 #include <UT/UT_Vector3.h>
00024 #include <UT/UT_Vector4.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033 class BV_API BV_LeafIterator
00034 {
00035 public:
00036 BV_LeafIterator();
00037 virtual ~BV_LeafIterator();
00038
00039
00040 void advance()
00041 { advanceSubclass(); }
00042
00043 void jump(int leafId)
00044 { jumpSubclass(leafId); }
00045
00046
00047
00048 bool atEnd() const
00049 { return atEndSubclass(); }
00050
00051 void rewind()
00052 { rewindSubclass(); }
00053
00054
00055 int getLeafId() const
00056 { return getLeafIdSubclass(); }
00057
00058 UT_Vector3 calcBarycenter() const
00059 { return calcBarycenterSubclass(); }
00060
00061 bool isDisabled() const
00062 { return isDisabledSubclass(); }
00063
00064
00065
00066
00067
00068 void advanceVertex()
00069 { advanceVertexSubclass(); }
00070 bool atEndVertex() const
00071 { return atEndVertexSubclass(); }
00072 void rewindVertex()
00073 { rewindVertexSubclass(); }
00074
00075 UT_Vector4 getVertex() const
00076 { return getVertexSubclass(); }
00077
00078
00079 virtual fpreal getVertexRadius() const
00080 { return 0.0f; }
00081
00082
00083
00084
00085 void setSkipDupVerts(bool flag)
00086 { mySkipDups = flag; setSkipDupVertsSubclass(flag); }
00087 bool getSkipDupVerts() const
00088 { return mySkipDups; }
00089
00090
00091 protected:
00092 virtual void advanceSubclass() = 0;
00093 virtual void jumpSubclass(int leafId) = 0;
00094 virtual bool atEndSubclass() const = 0;
00095 virtual void rewindSubclass() = 0;
00096 virtual int getLeafIdSubclass() const = 0;
00097
00098 virtual UT_Vector3 calcBarycenterSubclass() const = 0;
00099 virtual bool isDisabledSubclass() const;
00100
00101 virtual void advanceVertexSubclass() = 0;
00102 virtual bool atEndVertexSubclass() const = 0;
00103 virtual void rewindVertexSubclass() = 0;
00104 virtual UT_Vector4 getVertexSubclass() const = 0;
00105
00106 virtual void setSkipDupVertsSubclass(bool flag) = 0;
00107
00108 private:
00109
00110
00111 BV_LeafIterator(const BV_LeafIterator &);
00112 BV_LeafIterator &operator=(const BV_LeafIterator &);
00113
00114
00115 bool mySkipDups;
00116 };
00117
00118 #endif