00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BUILDERVERTEXTEMPL_H
00020 #define BUILDERVERTEXTEMPL_H
00021
00022 #include "pandabase.h"
00023
00024 #include "builderTypes.h"
00025 #include "builderAttribTempl.h"
00026 #include "builder_compare.h"
00027
00028 #include "notify.h"
00029 #include "pvector.h"
00030
00031
00032
00033
00034
00035
00036
00037
00038 template <class VT, class NT, class TT, class CT>
00039 class BuilderVertexTempl : public BuilderAttribTempl<VT, NT, TT, CT> {
00040 public:
00041 typedef VT VType;
00042 typedef NT NType;
00043 typedef TT TType;
00044 typedef CT CType;
00045
00046 INLINE BuilderVertexTempl();
00047 INLINE BuilderVertexTempl(const VType &c);
00048 INLINE BuilderVertexTempl(const BuilderVertexTempl ©);
00049 INLINE BuilderVertexTempl &operator = (const BuilderVertexTempl ©);
00050
00051 INLINE bool is_valid() const;
00052 INLINE BuilderVertexTempl &clear();
00053
00054 INLINE bool has_coord() const;
00055 INLINE VType get_coord() const;
00056 INLINE BuilderVertexTempl &set_coord(const VType &c);
00057
00058 INLINE BuilderVertexTempl &set_normal(const NType &c);
00059 INLINE BuilderVertexTempl &clear_normal();
00060
00061 INLINE bool has_texcoord() const;
00062 INLINE TType get_texcoord() const;
00063 INLINE BuilderVertexTempl &set_texcoord(const TType &t);
00064 INLINE BuilderVertexTempl &clear_texcoord();
00065
00066 INLINE BuilderVertexTempl &set_color(const CType &c);
00067 INLINE BuilderVertexTempl &clear_color();
00068
00069 INLINE BuilderVertexTempl &set_pixel_size(float s);
00070 INLINE BuilderVertexTempl &clear_pixel_size();
00071
00072 INLINE bool operator == (const BuilderVertexTempl &other) const;
00073 INLINE bool operator != (const BuilderVertexTempl &other) const;
00074 INLINE bool operator < (const BuilderVertexTempl &other) const;
00075 int compare_to(const BuilderVertexTempl &other) const;
00076
00077 ostream &output(ostream &out) const;
00078
00079 protected:
00080 VType _coord;
00081 TType _texcoord;
00082 };
00083
00084 template <class VT, class NT, class TT, class CT>
00085 INLINE ostream &operator << (ostream &out,
00086 const BuilderVertexTempl<VT, NT, TT, CT> &vertex) {
00087 return vertex.output(out);
00088 }
00089
00090
00091 #include "builderVertexTempl.I"
00092
00093 #endif