00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef RESCALENORMALATTRIB_H
00016 #define RESCALENORMALATTRIB_H
00017
00018 #include "pandabase.h"
00019
00020 #include "renderAttrib.h"
00021
00022 class FactoryParams;
00023
00024
00025
00026
00027
00028 class EXPCL_PANDA_PGRAPH RescaleNormalAttrib : public RenderAttrib {
00029 PUBLISHED:
00030 enum Mode {
00031
00032 M_none,
00033
00034
00035
00036 M_rescale,
00037
00038
00039 M_normalize,
00040
00041
00042
00043
00044 M_auto,
00045 };
00046
00047 private:
00048 INLINE RescaleNormalAttrib(Mode mode);
00049
00050 PUBLISHED:
00051 static CPT(RenderAttrib) make(Mode mode);
00052 static CPT(RenderAttrib) make_default();
00053
00054 INLINE Mode get_mode() const;
00055
00056 public:
00057 virtual void output(ostream &out) const;
00058
00059 protected:
00060 virtual int compare_to_impl(const RenderAttrib *other) const;
00061 virtual size_t get_hash_impl() const;
00062
00063 private:
00064 Mode _mode;
00065
00066 PUBLISHED:
00067 static int get_class_slot() {
00068 return _attrib_slot;
00069 }
00070 virtual int get_slot() const {
00071 return get_class_slot();
00072 }
00073
00074 public:
00075 static void register_with_read_factory();
00076 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00077
00078 protected:
00079 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00080 void fillin(DatagramIterator &scan, BamReader *manager);
00081
00082 public:
00083 static TypeHandle get_class_type() {
00084 return _type_handle;
00085 }
00086 static void init_type() {
00087 RenderAttrib::init_type();
00088 register_type(_type_handle, "RescaleNormalAttrib",
00089 RenderAttrib::get_class_type());
00090 _attrib_slot = register_slot(_type_handle, 100, make_default);
00091 }
00092 virtual TypeHandle get_type() const {
00093 return get_class_type();
00094 }
00095 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00096
00097 private:
00098 static TypeHandle _type_handle;
00099 static int _attrib_slot;
00100 };
00101
00102 EXPCL_PANDA_PGRAPH ostream &operator << (ostream &out, RescaleNormalAttrib::Mode mode);
00103 EXPCL_PANDA_PGRAPH istream &operator >> (istream &in, RescaleNormalAttrib::Mode &mode);
00104
00105 #include "rescaleNormalAttrib.I"
00106
00107 #endif
00108