00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SCISSORATTRIB_H
00016 #define SCISSORATTRIB_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 class EXPCL_PANDA_PGRAPH ScissorAttrib : public RenderAttrib {
00042 private:
00043 ScissorAttrib(const LVecBase4 &frame);
00044
00045 PUBLISHED:
00046 static CPT(RenderAttrib) make_off();
00047 INLINE static CPT(RenderAttrib) make(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
00048 static CPT(RenderAttrib) make(const LVecBase4 &frame);
00049 static CPT(RenderAttrib) make_default();
00050
00051 INLINE const LVecBase4 &get_frame() const;
00052
00053 public:
00054 virtual void output(ostream &out) const;
00055
00056 protected:
00057 virtual int compare_to_impl(const RenderAttrib *other) const;
00058 virtual size_t get_hash_impl() const;
00059 virtual CPT(RenderAttrib) compose_impl(const RenderAttrib *other) const;
00060
00061 private:
00062 LVecBase4 _frame;
00063 static CPT(RenderAttrib) _off;
00064
00065 PUBLISHED:
00066 static int get_class_slot() {
00067 return _attrib_slot;
00068 }
00069 virtual int get_slot() const {
00070 return get_class_slot();
00071 }
00072
00073 public:
00074 static void register_with_read_factory();
00075 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00076
00077 protected:
00078 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00079 void fillin(DatagramIterator &scan, BamReader *manager);
00080
00081 public:
00082 static TypeHandle get_class_type() {
00083 return _type_handle;
00084 }
00085 static void init_type() {
00086 RenderAttrib::init_type();
00087 register_type(_type_handle, "ScissorAttrib",
00088 RenderAttrib::get_class_type());
00089 _attrib_slot = register_slot(_type_handle, 100, make_default);
00090 }
00091 virtual TypeHandle get_type() const {
00092 return get_class_type();
00093 }
00094 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00095
00096 private:
00097 static TypeHandle _type_handle;
00098 static int _attrib_slot;
00099 };
00100
00101 #include "scissorAttrib.I"
00102
00103 #endif
00104