34 if (_empty_effect ==
nullptr) {
46add_on_occluder(
const NodePath &occluder)
const {
49 effect->_on_occluders.insert(occluder);
50 return return_new(effect);
58remove_on_occluder(
const NodePath &occluder)
const {
61 effect->_on_occluders.erase(occluder);
62 return return_new(effect);
69output(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()) {
131register_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);
186 int ni = areg->
find_node(node->get_type(), node->get_name());
195 _on_occluders.
sort();
223 effect->fillin(scan, manager);
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This global object records NodePaths that are referenced by scene graph attribs, such as ClipPlaneAtt...
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 ...
get_node
Returns the nth NodePath recorded in the registry.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void read_pointers(DatagramIterator &scan, int count)
A convenience function to read a contiguous list of pointers.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
A class to retrieve the individual data elements previously stored in a Datagram.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
bool is_empty() const
Returns true if the NodePath contains no nodes.
PandaNode * node() const
Returns the referenced node of the path.
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 ...
This functions similarly to a LightAttrib or ClipPlaneAttrib.
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 **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual bool require_fully_complete() const
Some objects require all of their nested pointers to have been completed before the objects themselve...
get_num_on_occluders
Returns the number of occluders that are enabled by the effectute.
A basic node of the scene graph or data graph.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
TypeHandle is the identifier used to differentiate C++ class types.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
Base class for objects that can be written to and read from Bam files.
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().
iterator_0 begin()
Returns the iterator that marks the first element in the ordered vector.
size_type_0 size() const
Returns the number of elements in the ordered vector.
bool empty() const
Returns true if the ordered vector is empty, false otherwise.
iterator_0 end()
Returns the iterator that marks the end of the ordered vector.
void sort()
Maps to sort_unique().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.