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