34 if (_empty_effect ==
nullptr) {
46 add_on_occluder(
const NodePath &occluder)
const {
49 effect->_on_occluders.insert(occluder);
50 return return_new(effect);
58 remove_on_occluder(
const NodePath &occluder)
const {
61 effect->_on_occluders.erase(occluder);
62 return return_new(effect);
69 output(std::ostream &out)
const {
70 out << get_type() <<
":";
71 if (_on_occluders.
empty()) {
76 Occluders::const_iterator li;
77 for (li = _on_occluders.
begin(); li != _on_occluders.
end(); ++li) {
79 out <<
" " << occluder;
99 DCAST_INTO_R(ta, other, 0);
101 Occluders::const_iterator li = _on_occluders.
begin();
102 Occluders::const_iterator oli = ta->_on_occluders.
begin();
104 while (li != _on_occluders.
end() && oli != ta->_on_occluders.
end()) {
108 int compare = occluder.
compare_to(other_occluder);
117 if (li != _on_occluders.
end()) {
120 if (oli != ta->_on_occluders.
end()) {
130 void OccluderEffect::
131 register_with_read_factory() {
147 Occluders::const_iterator nti;
149 for (nti = _on_occluders.
begin(); nti != _on_occluders.
end(); ++nti) {
153 for (nti = _on_occluders.
begin(); nti != _on_occluders.
end(); ++nti) {
154 (*nti).write_datagram(manager, dg);
169 for (
size_t i = 0; i < _on_occluders.
size(); ++i) {
170 pi += _on_occluders[i].complete_pointers(p_list + pi, manager);
172 int n = areg->
find_node(_on_occluders[i]);
175 _on_occluders[i] = areg->
get_node(n);
180 Occluders::iterator ci;
181 ci = _on_occluders.
begin();
182 while (ci != _on_occluders.
end()) {
184 DCAST_INTO_R(
node, p_list[pi++], pi);
195 _on_occluders.
sort();
223 effect->fillin(scan, manager);
232 void OccluderEffect::
234 RenderEffect::fillin(scan, manager);
239 _on_occluders.resize(num_on_occluders);
241 for (
int i = 0; i < num_on_occluders; i++) {
242 _on_occluders[i].fillin(scan, manager);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath()
This constructs an empty NodePath with no nodes.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
bool is_empty() const
Returns true if the NodePath contains no nodes.
size_type_0 size() const
Returns the number of elements in the ordered vector.
This global object records NodePaths that are referenced by scene graph attribs, such as ClipPlaneAtt...
int compare_to(const NodePath &other) const
Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
iterator_0 begin()
Returns the iterator that marks the first element in the ordered vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
iterator_0 end()
Returns the iterator that marks the end of the ordered vector.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
bool empty() const
Returns true if the ordered vector is empty, false otherwise.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
int find_node(const NodePath &attrib_node) const
Returns the index number of the indicated NodePath in the registry (assuming its name hasn't changed ...
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().
This functions similarly to a LightAttrib or ClipPlaneAttrib.
void read_pointers(DatagramIterator &scan, int count)
A convenience function to read a contiguous list of pointers.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
void sort()
Maps to sort_unique().
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_num_on_occluders
Returns the number of occluders that are enabled by the effectute.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
PandaNode * node() const
Returns the referenced node of the path.
CPT(RenderEffect) OccluderEffect
Constructs a new OccluderEffect object that does nothing.
get_node
Returns the nth NodePath recorded in the registry.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool require_fully_complete() const
Some objects require all of their nested pointers to have been completed before the objects themselve...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.