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