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