00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EGGATTRIBUTES_H
00020 #define EGGATTRIBUTES_H
00021
00022 #include <pandabase.h>
00023
00024 #include "eggMorphList.h"
00025
00026 #include <typedObject.h>
00027 #include <luse.h>
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class EXPCL_PANDAEGG EggAttributes {
00041 public:
00042 EggAttributes();
00043 EggAttributes(const EggAttributes ©);
00044 EggAttributes &operator = (const EggAttributes ©);
00045 virtual ~EggAttributes();
00046
00047 INLINE bool has_normal() const;
00048 INLINE const Normald &get_normal() const;
00049 INLINE void set_normal(const Normald &normal);
00050 INLINE void clear_normal();
00051
00052 INLINE bool has_uv() const;
00053 INLINE const TexCoordd &get_uv() const;
00054 INLINE void set_uv(const TexCoordd &texCoord);
00055 INLINE void clear_uv();
00056
00057 INLINE bool has_color() const;
00058 INLINE Colorf get_color() const;
00059 INLINE void set_color(const Colorf &Color);
00060 INLINE void clear_color();
00061
00062 void write(ostream &out, int indent_level) const;
00063 bool sorts_less_than(const EggAttributes &other) const;
00064
00065 void transform(const LMatrix4d &mat);
00066
00067 EggMorphNormalList _dnormals;
00068 EggMorphTexCoordList _duvs;
00069 EggMorphColorList _drgbas;
00070
00071 private:
00072 enum Flags {
00073 F_has_normal = 0x001,
00074 F_has_uv = 0x002,
00075 F_has_color = 0x004,
00076 };
00077
00078 int _flags;
00079 Normald _normal;
00080 TexCoordd _uv;
00081 Colorf _color;
00082
00083
00084 public:
00085 static TypeHandle get_class_type() {
00086 return _type_handle;
00087 }
00088 static void init_type() {
00089 register_type(_type_handle, "EggAttributes");
00090 }
00091
00092 private:
00093 static TypeHandle _type_handle;
00094 };
00095
00096 #include "eggAttributes.I"
00097
00098 #endif
00099