14#ifndef LIGHTRAMPATTRIB_H
15#define LIGHTRAMPATTRIB_H
28class EXPCL_PANDA_PGRAPH LightRampAttrib :
public RenderAttrib {
30 INLINE LightRampAttrib();
45 static CPT(RenderAttrib)
make_double_threshold(PN_stdfloat thresh0, PN_stdfloat lev0, PN_stdfloat thresh1, PN_stdfloat lev1);
51 INLINE LightRampMode
get_mode()
const;
52 INLINE PN_stdfloat
get_level(
int n)
const;
59 virtual void output(std::ostream &out)
const;
62 virtual int compare_to_impl(
const RenderAttrib *other)
const;
63 virtual size_t get_hash_impl()
const;
67 PN_stdfloat _level[2];
68 PN_stdfloat _threshold[2];
70 static CPT(RenderAttrib) _default;
73 static int get_class_slot() {
76 virtual int get_slot()
const {
77 return get_class_slot();
79 MAKE_PROPERTY(class_slot, get_class_slot);
82 static void register_with_read_factory();
86 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
87 void fillin(DatagramIterator &scan, BamReader *manager);
90 static TypeHandle get_class_type() {
93 static void init_type() {
94 RenderAttrib::init_type();
96 RenderAttrib::get_class_type());
97 _attrib_slot =
register_slot(_type_handle, 100,
new LightRampAttrib);
99 virtual TypeHandle get_type()
const {
100 return get_class_type();
102 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
105 static TypeHandle _type_handle;
106 static int _attrib_slot;
An instance of this class is passed to the Factory when requesting it to do its business and construc...
static ConstPointerTo< RenderAttrib > make_hdr2()
Constructs a new LightRampAttrib object.
get_mode
Returns the LightRampAttrib mode.
static ConstPointerTo< RenderAttrib > make_single_threshold(PN_stdfloat thresh0, PN_stdfloat lev0)
Constructs a new LightRampAttrib object.
PN_stdfloat get_level(int n) const
Returns the nth lighting level.
static ConstPointerTo< RenderAttrib > make_identity()
Constructs a new LightRampAttrib object.
static ConstPointerTo< RenderAttrib > make_double_threshold(PN_stdfloat thresh0, PN_stdfloat lev0, PN_stdfloat thresh1, PN_stdfloat lev1)
Constructs a new LightRampAttrib object.
PN_stdfloat get_threshold(int n) const
Returns the nth threshold level.
static ConstPointerTo< RenderAttrib > make_hdr1()
Constructs a new LightRampAttrib object.
static ConstPointerTo< RenderAttrib > make_default()
Constructs a new LightRampAttrib object.
static ConstPointerTo< RenderAttrib > make_hdr0()
Constructs a new LightRampAttrib object.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.