18 #include "pandabase.h"
21 #include "renderAttrib.h"
23 #include "ordered_vector.h"
36 INLINE LightAttrib(
const LightAttrib ©);
60 Operation get_operation()
const;
62 int get_num_lights()
const;
63 Light *get_light(
int n)
const;
64 bool has_light(
Light *light)
const;
75 INLINE
int get_num_on_lights()
const;
76 INLINE
NodePath get_on_light(
int n)
const;
77 MAKE_SEQ(get_on_lights, get_num_on_lights, get_on_light);
78 INLINE
bool has_on_light(
const NodePath &light)
const;
80 INLINE
int get_num_off_lights()
const;
81 INLINE
NodePath get_off_light(
int n)
const;
82 MAKE_SEQ(get_off_lights, get_num_off_lights, get_off_light);
83 INLINE
bool has_off_light(
const NodePath &light)
const;
84 INLINE
bool has_all_off()
const;
86 INLINE
bool is_identity()
const;
93 CPT(LightAttrib) filter_to_max(
int max_lights)
const;
94 NodePath get_most_important_light()
const;
97 virtual void output(ostream &out)
const;
98 virtual void write(ostream &out,
int indent_level)
const;
101 virtual int compare_to_impl(
const RenderAttrib *other)
const;
102 virtual size_t get_hash_impl()
const;
108 INLINE
void check_filtered()
const;
109 void sort_on_lights();
113 Lights _on_lights, _off_lights;
114 bool _off_all_lights;
125 static int get_class_slot() {
128 virtual int get_slot()
const {
129 return get_class_slot();
147 static void register_with_read_factory();
161 static void init_type() {
162 RenderAttrib::init_type();
163 register_type(_type_handle,
"LightAttrib",
164 RenderAttrib::get_class_type());
165 _attrib_slot =
register_slot(_type_handle, 20, make_default);
168 return get_class_type();
170 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
174 static int _attrib_slot;
177 #include "lightAttrib.I"
static int register_slot(TypeHandle type_handle, int sort, RenderAttribRegistry::MakeDefaultFunc *make_default_func)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
The abstract interface to all kinds of lights.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Indicates which set of lights should be considered "on" to illuminate geometry at this level and belo...